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

What are the rules for identifiers in c?

1028


How can you convert integers to binary or hexadecimal?

979


What is the -> in c?

955


Why do we use pointer to pointer in c?

1021


What is the difference between functions getch() and getche()?

1035


Is c high or low level?

963


What is the 'named constructor idiom'?

1032


What is the use of void pointer and null pointer in c language?

1070


Explain how do you determine the length of a string value that was stored in a variable?

1093


Can you add pointers together? Why would you?

1072


Is it valid to address one element beyond the end of an array?

1121


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1075


What are identifiers c?

1020


what is the different bitween abap and abap-hr?

2217


What is malloc and calloc?

1004