//Modulues of two integer values entered by user.
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,modules; //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.
modules=num1%num2;
printf("modules:%d",modules); //Modules of two numbers
getch(); //Hold the screen for output
}
Output:
Enter the first number of an integer:20Enter the second number of an integer:6
modules:2
No comments:
Post a Comment