Write a complete C program that reads two whole numbers into two variables of type int and then outputs both the whole number part and the remainder when the first number is divided by the second. This can be done using the operators / and %.

Respuesta :

Answer:

#include <stdio.h>

int main() {

   int dividend, divisor, quotient, remainder;

   printf("Enter dividend: ");

   scanf("%d", &dividend);

   printf("Enter divisor: ");

   scanf("%d", &divisor);

   // Computes quotient

   quotient = dividend / divisor;

   // Computes remainder

   remainder = dividend % divisor;

   printf("Quotient = %d\n", quotient);

   printf("Remainder = %d", remainder);

   return 0;

}

Explanation:

ACCESS MORE