Thursday, February 12, 2015

C Program to find quotient and remainder of two numbers


#include<iostream.h>
#include<conio.h>


void main()
{
clrscr();
int a,b,q,r;
cout<<"Enter two numbers:";
cin>>a>>b;


if(a>b)
{
q=a/b;
r=a%b;
cout<<"
Quotient="<<q;

cout<<"
Remainder="<<r;

}
else
cout<<"
First no. should be greater than second no....!!!";



getch();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.