Call us at 0700-922-6559 or Click here

Write a program to Compute Quotient and Remainder

#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;

}

Output-

Enter dividend: 8

Enter divisor: 2

Quotient = 4

Remainder = 0

Leave a Reply

Your email address will not be published. Required fields are marked *