HOW TO WRITE A PROGRAM OF AN INTEGER DIVISION & THEIR REMAINDERS.
Program Code:
#include<stdio.h>
int main(void)
{
printf("%d", 15/2);
printf("%d", 15%2);
printf("%d", 16/2);
printf("%d", 16%2);
return 0 ;
}
Output |
[N.B: Simple calculation is 15/2= 7.5, so it first take "7" then remainder value is "1", as same for 16/2= 8, so it first take "8" then remainder value is "0". Hence the output is: 7180 ]
No comments:
Post a Comment