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
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
Is c easier than java?
What is the concatenation operator?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Explain the use of #pragma exit?
How can I open a file so that other programs can update it at the same time?
What is a structure member in c?
What is strcmp in c?
How do I read the arrow keys? What about function keys?
What is the symbol indicated the c-preprocessor?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
what is the basis for selection of arrays or pointers as data structure in a program
What are data types in c language?
What is scope of variable in c?