C program to Find Remainder of Division


C program to Find Remainder of Division




// C program to Find Remainder of Division
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter first number:\n");
scanf("%d",&a);

printf("Enter second number:\n");
scanf("%d",&b);
c=a%b;
printf("Output\n");
printf("The remainder of division is:%d\n",c);
printf("End of program");
}


Enter first number:

100

Enter second number:

15

Output

The remainder of division is:10

End of program




// C program to Find Remainder of Division
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two numbers:\n");
scanf("%d%d",&a,&b);
c=a%b;
printf("Output\n");
printf("The remainder of division is:%d\n",c);
printf("End of program");
}


Enter two numbers:

100 15

Output

The remainder of division is:10

End of program



// C program to Find Remainder of Division
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two numbers:\n");
scanf("%d%d",&a,&b);
printf("Output\n");
printf("The remainder of division is:%d\n", a%b);
printf("End of program");
}


Enter two numbers:

100 15

Output

The remainder of division is:10

End of program


In the above program remainder of division is not stored in any variable. Direct division process has been takes place in printf() function.

टिप्पणी पोस्ट करा

0 टिप्पण्या