Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers using if/else statement?
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 |
what is the use of a array in c
what is the difference between declaration ,defenetion and initialization of a variable?
The statement, int(*x[]) () what does in indicate?
why we use "include" word before calling the header file. is there any special name for that include??????
void main() { int i=5; printf("%d",i++ + ++i); }
What is function and its example?
Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc
which is the best antivirus and how to update it
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?
how to get the starting address of file stored in harddisk through 'C'program.
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.