C Online Compiler
Example: C Program to Find Quotient and Remainder of Two Integers
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Find Quotient and Remainder of Two Integers #include <stdio.h> int main() { int dn, dr, qu, rem; // dn - denotes the dividend // dr - denotes the divisor // qu -denotes the Quotient // rem - denotes the remainder printf("-----Enter the dividend & divisor to compute the quotient and remainder-----\n"); scanf("%d%d", &dn, &dr); qu = dn / dr; // Computes the quotient rem = dn % dr; // Computes the remainder printf("\n\nThe Quotient is %d\n", qu); printf("The Remainder is %d\n", rem); return 0; }
31 5
Output
Clear
ADVERTISEMENTS