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...


Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers using if/else statement?



Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers usi..

Answer / guest

void main()
{
int n,a,b;
sanf("%d%d",&a,&b);
printf("select one of these");
printf("1.addition
2.subtraction
3.multiplication
4.division");
scanf("%d",&n);
if(n==1)
{
printf("%d",a+b);
}
else if(n==2)
{
printf("%d",a-b);
}
else if(n==3)
{
printf("%d",a*b);
}
else if(n==4)
{
printf("%d",a/b);
}
else
{
printf("nothing to print");
}
}

Is This Answer Correct ?    13 Yes 4 No

Post New Answer

More C Interview Questions

What are disadvantages of C language.

0 Answers   iNautix,


How to write a code for reverse of string without using string functions?

0 Answers   TCS,


Why c is faster than c++?

0 Answers  


why we use "include" word before calling the header file. is there any special name for that include??????

1 Answers   TCS,


#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}

3 Answers  


When should the volatile modifier be used?

0 Answers  


if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?

4 Answers   Amazon, Apple, Bata, Google, NASA,


without using arithmatic operator convert an intger variable x into x+1

3 Answers  


how to count no of words,characters,lines in a paragraph.

0 Answers  


Why do we need arrays in c?

0 Answers  


Is main an identifier in c?

0 Answers  


Explain how do you search data in a data file using random access method?

0 Answers  


Categories