C Programming

C Program to Divide Integer Find the Quotient and Remainder

Write a program to divide an integer by another integer and find the quotient and remainder.

C Code

#include <stdio.h>
#include <conio.h>
void main()
{
int a,b,quo,rem;
clrscr();
printf("Enter two numbers A and B:");
scanf("%d%d",&a,&b);
quo=a/b;
rem=a%b;
printf("The Quotient=%d",quo);
printf("n The Remainder=%d",rem);
getch();
}

Output

fa

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.