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
Compare array data type to pointer data type
Where is c used?
What is the use of typedef in structure in c?
What is difference between Structure and Unions?
Explain enumerated types.
What do the functions atoi(), itoa() and gcvt() do?
what are bit fields in c?
What functions are in conio h?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is function prototype in c with example?
When should a type cast be used?
Explain the difference between the local variable and global variable in c?
Is there any data type in c with variable size?
Is python a c language?
Explain what is the benefit of using const for declaring constants?