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
Is there any demerits of using pointer?
What does a function declared as pascal do differently?
Are global variables static in c?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
Explain what is the use of a semicolon (;) at the end of every program statement?
When do we get logical errors?
All technical questions
What are the primitive data types in c?
What is nested structure with example?
What is actual argument?
What are the functions to open and close the file in c language?
How can I access an I o board directly?
What is a floating point in c?
How many bytes is a struct in c?
What are the disadvantages of external storage class?