C Program to Divide Integer Find the Quotient and Remainder

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

TutsMaster.org

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.