CODE BOX
Pages
Home
Data Types
Algorithms
Easy Find
Linux Commands
Friday, 4 September 2015
WAP to find out the quotient and remainder of two numbers. ( Without using modulus ( % ) operator)
#include <stdio.h>
int main ()
{
int x,y,q,r;
printf("Enter Divisor: ");
scanf("%d",&x);
printf("Enter Dividend: ");
scanf("%d",&y);
q=y/x;
r=y-(x*q);
printf("Quotient is %d\n",q);
printf("Remainder is %d\n",r);
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment