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
Why is c called a structured programming language?
Why do we use pointer to pointer in c?
What does it mean when the linker says that _end is undefined?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
What is assignment operator?
Define and explain about ! Operator?
Can a local variable be volatile in c?
What is the use of header?
Explain how can I open a file so that other programs can update it at the same time?
what do the 'c' and 'v' in argc and argv stand for?
What is the significance of an algorithm to C programming?
Explain what is a 'locale'?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
I need testPalindrome and removeSpace
#include