Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / venkat raj

#include<stdio.h>
#include<conio.h>



int remainder;

void main()
{
int dividend, divisor;
int quotient;
int division(int,int);

printf("Enter the value of Dividend and Divisor\n");
scanf("%d %d",&dividend,&divisor);


quotient = division(dividend,divisor);

printf("The Quotient is %d\n",quotient);
printf("The Remainder is %d\n",remainder);

}

int division(int dividend,int divisor)
{

int quotient=0,tempdivisor = divisor;


if(dividend == divisor)
{

remainder=0;
return 1;
}
else if (dividend < divisor)
{

remainder=1;
return 0;
}

while(tempdivisor <= dividend)
{
tempdivisor = tempdivisor + divisor;
quotient = quotient++;
}
remainder=dividend-(tempdivisor-divisor);



return quotient;



}

Is This Answer Correct ?    18 Yes 6 No

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

Answer / 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

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

Answer / mahfooz alam

#include <iostream>
using namespace std;
int main()
{
int a,b;
cout<<"enter two number"<<endl;
int r,q=0,bi,s;
cin>>a>>b;
if(a<b)
{
s=a;
bi=b;
}
else
{
s=b;
bi=a;
}
r=bi-s;
q++;
while(r>=s)
{
q++;
r=r-s;
}//endl of while.*/
cout<<"remainder is "<<r<<" quotient is "<<q<<endl;
return 0;
}

Is This Answer Correct ?    13 Yes 8 No

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

Answer / y hussain reddy

void main()
{
int a,b;
int c=0;
printf("nter a,b");
scanf("%d %d ",&a,&b);
while(a>=b)
{ c++;
a=a-b;
}
printf("a/b=%d",c);
printf("a%b=%d",a);
}

Is This Answer Correct ?    12 Yes 7 No

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

Answer / mohammad haris

#include <stdio.h>

int main()
{
int cDivident,cDivisor,cRemainder;

printf("\nEnter Divident and Divisor :\n");
while(!(scanf("%d %d",&cDivident,&cDivisor)))
{
printf("\nPlease Enter Integers!!!:");
fflush(stdin);
}
cRemainder = cDivident;
while ( cRemainder >= cDivisor)
{
cDivident = cDivident - cDivisor;
cRemainder = cDivident;
}

printf("\nReminder = %d",cRemainder);
return 0;
}

Is This Answer Correct ?    10 Yes 6 No

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

Answer / 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

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

Answer / suma

#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,i,remaider,q;
i=0;
printf("Enter two numbers\n");
scanf("&d,&d",x,y);

do
{
x=x-y;
i=i+1;
}while(x>=y)

if (x<y)
{
remainder=x;
q=i;

}
printf("the remainder is ",x);
printf("the quotient is ",q);

}

Is This Answer Correct ?    8 Yes 7 No

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

Answer / santhi perumal

#include<stdio.h>
#include<conio.h>

int remainder, tempdevisor ,i = 0;

int division(int,int);

int main()
{
int dividend, divisor;
int quotient;

printf("Enter the value of Dividend and Divisor\n");
scanf("%d %d",&dividend,&divisor);

tempdevisor = divisor;
quotient = division(dividend,divisor);

printf("The Quotient is %d\n",quotient);
printf("The Remainder is %d\n",remainder);
}

int division(int dividend,int divisor)
{

int quotient = 1;
i++;

if(dividend == divisor)
{
remainder = 0;
return 1;
}
else if (dividend < divisor)
{
remainder = dividend;
return 0;
}

while(divisor <= dividend)
{
divisor = divisor<<1;
quotient = quotient<<1;
}
divisor = divisor>>1;
quotient = quotient>>1;

// printf("Quotient in the %d iteration is %d\n",i,quotient);
quotient = quotient + division(dividend-divisor,tempdevisor);

return quotient;



}

Is This Answer Correct ?    16 Yes 16 No

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

Answer / blag

#include<tsaka.h>
#include<iro.h>
main saging()
{
rarw;

getch();
}

Is This Answer Correct ?    0 Yes 1 No

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

Answer / 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

More C Interview Questions

String concatenation

2 Answers  


What is an object?

5 Answers  


what will happen if you free a pointer twice after allocating memory dynamically ?

3 Answers   Novell,


Is it possible to create recycle bin in mobiles?

2 Answers  


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

0 Answers  


What is the difference between typedef and #define?

0 Answers  


What is the use of structure padding in c?

0 Answers  


a=(1,2,3); b=1,2,3; c=1,(2,3); d=(1,2),3; what's the value of 'a','b','c','d'

2 Answers  


What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation

10 Answers   IBM,


how to print 212 as Twohundreds twelve plz provide me ans soon

1 Answers  


Explain what?s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?

1 Answers  


Explain what is meant by high-order and low-order bytes?

0 Answers  


Categories