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 do you declare a variable that will hold string values?

1105


How can you call a function, given its name as a string?

1099


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

2231


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1002


What is difference between main and void main?

1117


Can I initialize unions?

987


Can a variable be both constant and volatile?

1045


What is a 'null pointer assignment' error?

1162


What is const and volatile in c?

989


Explain what is dynamic data structure?

1116


What is 02d in c?

1028


explain what is fifo?

1027


What is a program flowchart?

1125


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1923


Should I learn c before c++?

1177