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
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
Explain how can I prevent another program from modifying part of a file that I am modifying?
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
What are the different types of data structures in c?
Explain how can you check to see whether a symbol is defined?
How to define structures? ·
How important is structure in life?
Can we access the array using a pointer in c language?
What is atoi and atof in c?
FILE PROGRAMMING
Why do we use stdio h and conio h?
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
What is volatile variable how do you declare it?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Is r written in c?