9-Write a C program to calculate quotient and remainder.

Program: 9

Write a C program to calculate quotient and remainder.

#include
#include
void main()
{
    int a, b, q, r;
    printf("Enter the dividend: ");
    scanf("%d", &a);
    printf("Enter the divisor: ");
    scanf("%d", &b);
    q=a/b;
    r=a%b;
    printf("\nThe value of quotient is: %d\n", q);
    printf("The value of remainder is: %d", r);
    getch();
}
Output
Enter the dividend: 323

Enter the divisor: 4

The value of quotient is: 80

The value of remainder is: 3

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.