C PROGRAM FOR DIVISION

 We will make a program for division such that it will calculate quotient and remainder also.

#include <stdio.h>

int main() {

    int dividend, divisor, quotient, remainder;

    printf("Enter dividend: ");

    scanf("%d", &dividend);

    printf("Enter divisor: ");

    scanf("%d", &divisor);

    quotient = dividend / divisor;

    remainder = dividend % divisor;

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

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

   }

    

No comments:

Post a Comment