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 |
Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.
Magic square
Explain the use of 'auto' keyword
why wipro wase
What is property type c?
What are the valid places to have keyword “break”?
How can I recover the file name given an open stream?
Can we initialize extern variable in c?
What is a program flowchart and explain how does it help in writing a program?
wtite a program that will multiply two integers in recursion function
Why doesn't C have nested functions?
Can anyone help me with this please? Need to print the below values.. Thanks 1 1 2 1 2 3 1 2 3 4