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 use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Why is this loop always executing once?
What are the types of data structures in c?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
write a proram to reverse the string using switch case?
What is const volatile variable in c?
What is keyword with example?
What is time null in c?
Why is c not oop?
What is an auto variable in c?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
If null and 0 are equivalent as null pointer constants, which should I use?
What does do in c?
How many keywords (reserve words) are in c?
Why clrscr is used after variable declaration?