program to get the remainder and quotant of given two
numbers with out using % and / operators?
Answer Posted / kadher masthan..,sit
#include <stdio.h>
#include<conio.h>
void main()
{
int a,b,a1,b1,rem=0;
scanf(“%d %d”,&a,&b);
if(a>b)
{
a1=a;
b1=b;
}
else
{
a1=b;
b1=a;
}
while(a1>=b1)
{
rem++;
a1-=b1;
}
printf(" remainder is %d quotient is %d",rem,a1);
}
| Is This Answer Correct ? | 16 Yes | 8 No |
Post New Answer View All Answers
Why does everyone say not to use scanf? What should I use instead?
What is C language ?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What is the purpose of ftell?
If I have a char * variable pointing to the name of a function ..
How can you pass an array to a function by value?
What is the difference between fread buffer() and fwrite buffer()?
What are file streams?
Why C language is a procedural language?
What are the advantages of using new operator as compared to the function malloc ()?
Is c# a good language?
Explain how can you tell whether two strings are the same?
Can you subtract pointers from each other? Why would you?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is exit() function?