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 / babitha

# include <stdio.h>
# include <conio.h>
void main()
{

unsigned int dividened,divisor,quotient=0,remainder;

printf("\nenter a dividened");
scanf("%d",&dividened);

printf("\n enter a divisor");
scanf("%d",&divisor);

while(dividened >divisor)
{

quotient++;
dividened=dividened-divisor;


}
if(dividened==divisor)
{
remainder=0;
quotient++;
}
else
{
remainder=dividened;
}

printf("\n quotient of %d / %d is %d",
(quotient*divisor+remainder),divisor,quotient);
printf("\n remainder of %d / %d is %d",
(quotient*divisor+remainder),divisor,remainder);

getch();
}

Is This Answer Correct ?    13 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does pointer work in c?

1122


What is meant by high-order and low-order bytes?

1047


What is the right way to use errno?

1051


What are all different types of pointers in c?

1007


Do array subscripts always start with zero?

1299


How can you determine the size of an allocated portion of memory?

1299


What is the total generic pointer type?

1157


Can you write a programmer for FACTORIAL using recursion?

1041


What does %p mean c?

1063


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1250


What is the best organizational structure?

1123


Difference between constant pointer and pointer to a constant.

1140


What are the two types of structure?

1087


The difference between printf and fprintf is ?

1285


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1114