//Division of two integer values entered by user.
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,division; //declare a integer varaiable
clrscr(); //clear the screen
printf("Enter the first number of an integer:"); //Show the message to user
scanf("%d",&num1); //Store the value entered by user in variable num1.
printf("Enter the second number of an integer:"); //Show the message to user
scanf("%d",&num2); //Store the value entered by user in variable num2.
division=num1/num2;
printf("Division:%d",division); //Multiplication of two numbers
printf("\nAlso show division of two integer numbers in other way:");
printf("\n%d / %d = %d",num1,num2,division);
getch(); //Hold the screen for output
}
Output:
Enter the first number of an integer:44Enter the second number of an integer:11
Division:4
Also show division of two integer numbers in other way:
44 / 11 = 4
No comments:
Post a Comment