Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

program to get the remainder and quotant of given two
numbers with out using % and / operators?

Answer Posted / brad

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,r1,r2,count=0;
printf("Enter two numbers\n");
scanf("&d,&d",a,b);
if(a>b)
{
r1=a;
r2=b;
}
else
{
r1=b;
r2=a;
}
do
{
res=r1-r2;
r1=res;
count++;
}
while(r1>=r2);
printf("the remainder is ",res);
printf("the quotient is ",count);
}

Is This Answer Correct ?    3 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where in memory are my variables stored?

1126


How many keywords are there in c?

1035


What is a stream?

1092


How many main () function we can have in a project?

1073


How to find a missed value, if you want to store 100 values in a 99 sized array?

1374


What is the use of define in c?

1016


What is the advantage of using #define to declare a constant?

1049


What is stack in c?

1036


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

992


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

1060


What is the purpose of realloc()?

1099


Is sizeof a keyword in c?

923


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2055


Differentiate between #include<...> and #include '...'

1016


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1876