program to get the remainder and quotant of given two
numbers with out using % and / operators?
Answer Posted / babitha
# include <stdio.h>
# include <conio.h>
void main()
{
unsigned int dividened,divisor,quotient=0,remainder;
printf("\nenter a dividened");
scanf("%d",÷ned);
printf("\n enter a divisor");
scanf("%d",&divisor);
while(dividened >divisor)
{
quotient++;
dividened=dividened-divisor;
}
if(dividened==divisor)
{
remainder=0;
quotient++;
}
else
{
remainder=dividened;
}
printf("\n quotient of %d / %d is %d",
(quotient*divisor+remainder),divisor,quotient);
printf("\n remainder of %d / %d is %d",
(quotient*divisor+remainder),divisor,remainder);
getch();
}
Is This Answer Correct ? | 13 Yes | 12 No |
Post New Answer View All Answers
Explain enumerated types.
Explain what header files do I need in order to define the standard library functions I use?
hi, which software companys will take,if d candidate's % is jst 55%?
What is advantage of pointer in c?
What is time null in c?
What are the difference between a free-standing and a hosted environment?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is main () in c language?
if p is a string contained in a string?
Can a void pointer point to a function?
What is the difference between text files and binary files?
What are the 4 types of functions?
What is volatile keyword in c?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Define VARIABLE?