"The best way to cheer yourself up is to try to cheer somebody else up." Mark Twain

Monday, April 26, 2010

WAP to input dividend and divisor. Calculate quotient and remainder.


#include<iostream.h>
#include<conio.h>
void main()
{
int div, dis, q , r;

cout<< "Enter dividend & divisor :";
cin >> div >> dis;

q = div / dis;
r  = div % dis;

cout << " Quotient = " << q;
cout << "Remainder = " << r;

getch();
}

No comments:

Post a Comment

C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.
Now Playing: Ballade Pour Adeline

About Me

My photo
I m an IT lecturer of a college. I love social-work. I want to do something beneficial for society before dying , that can promote our society, to some extent.