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 is the use of a array in c

6 Answers  


what is the difference between declaration ,defenetion and initialization of a variable?

7 Answers   LG Soft,


The statement, int(*x[]) () what does in indicate?

0 Answers  


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

1 Answers   TCS,


void main() { int i=5; printf("%d",i++ + ++i); }

21 Answers   ME,


What is function and its example?

0 Answers  


Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc

4 Answers  


which is the best antivirus and how to update it

7 Answers   Infosys,


What are Storage Classes in C ?

32 Answers   CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,


Why c is called free form language?

0 Answers  


how to get the starting address of file stored in harddisk through 'C'program.

2 Answers   Siemens,


write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.

6 Answers  


Categories