program to get the remainder and quotant of given two
numbers with out using % and / operators?

Answer Posted / brad

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,r1,r2,count=0;
printf("Enter two numbers\n");
scanf("&d,&d",a,b);
if(a>b)
{
r1=a;
r2=b;
}
else
{
r1=b;
r2=a;
}
do
{
res=r1-r2;
r1=res;
count++;
}
while(r1>=r2);
printf("the remainder is ",res);
printf("the quotient is ",count);
}

Is This Answer Correct ?    3 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

638


Explain how can I prevent another program from modifying part of a file that I am modifying?

642


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

1122


What are the different types of data structures in c?

609


Explain how can you check to see whether a symbol is defined?

664






‎How to define structures? · ‎

631


How important is structure in life?

594


Can we access the array using a pointer in c language?

564


What is atoi and atof in c?

619


FILE PROGRAMMING

1780


Why do we use stdio h and conio h?

639


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

1420


What is volatile variable how do you declare it?

567


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1929


Is r written in c?

725