Write program to calculate remainder by dividing 5 from 1 to 30
Use Modulus remainder operator.
#include <stdio.h> #define VALUE 5//from w w w . j a v a2 s . co m int main() { int a; printf("Modulus %d:\n",VALUE); for(a=0;a<30;a++) printf("%d %% %d = %d\n",a,VALUE,a%VALUE); return(0); }