/*********************************************************************************************************** * * 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 **/ if (b == 0) /** refuses divisor of 0 **/ {printf("The second number must be greater than zero.\n");} else {while (a >= b) (a = a - b); /*** subtracts b from a until a