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",&dividened);

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


Please Help Members By Posting Answers For Below Questions

Explain enumerated types.

607


Explain what header files do I need in order to define the standard library functions I use?

653


hi, which software companys will take,if d candidate's % is jst 55%?

1671


What is advantage of pointer in c?

705


What is time null in c?

589






What are the difference between a free-standing and a hosted environment?

751


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

1866


What is main () in c language?

608


if p is a string contained in a string?

1415


Can a void pointer point to a function?

581


What is the difference between text files and binary files?

682


What are the 4 types of functions?

579


What is volatile keyword in c?

587


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2438


Define VARIABLE?

692