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
Write a program to swap two numbers without using the third variable?
Define macros.
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What does 3 mean in texting?
Is linux written in c?
Why is structure padding done in c?
Are the outer parentheses in return statements really optional?
Is c object oriented?
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...
What are the types of data structures in c?
What are all different types of pointers in c?
How can you access memory located at a certain address?
What is pointer in c?
What is cohesion and coupling in c?
What are structures and unions? State differencves between them.