/*********************************************************************************************************** * * Description: This program takes in 2 integers, and prints the remainder when the * first is divided by the second. * * Input: 2 positive integers * * Output: Remainder * * ***********************************************************************************************************/ #include main() { int a, b; printf("Please type in two positive integers.\n"); /** prompts user **/ scanf("%d %d", &a,&b); printf("[%d %d]\n", a, b); /** echoes to screen **/ while(a>=b) {a = a-b;} /*** subtracts b from a until there is a remainder smaller than b ***/ printf("The remainder is %d.\n", a); }