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 / mohammad haris

#include <stdio.h>

int main()
{
int cDivident,cDivisor,cRemainder;

printf("\nEnter Divident and Divisor :\n");
while(!(scanf("%d %d",&cDivident,&cDivisor)))
{
printf("\nPlease Enter Integers!!!:");
fflush(stdin);
}
cRemainder = cDivident;
while ( cRemainder >= cDivisor)
{
cDivident = cDivident - cDivisor;
cRemainder = cDivident;
}

printf("\nReminder = %d",cRemainder);
return 0;
}

Is This Answer Correct ?    10 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to swap two numbers without using the third variable?

1078


Define macros.

1283


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2076


What does 3 mean in texting?

1110


Is linux written in c?

1043


Why is structure padding done in c?

1137


Are the outer parentheses in return statements really optional?

1122


Is c object oriented?

975


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

10211


What are the types of data structures in c?

1160


What are all different types of pointers in c?

1012


How can you access memory located at a certain address?

1124


What is pointer in c?

1206


What is cohesion and coupling in c?

1038


What are structures and unions? State differencves between them.

1183