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 |
Write a programe print the sum of series 0,1,2,.....10
What is identifiers in c with examples?
What should not contain a header file?
Explain what are bus errors, memory faults, and core dumps?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
Why is C language being considered a middle level language?
What is the difference between null pointer and void pointer
10 Answers CTS, Manforce, MAQ Software,
why r u join this company? give solid resons.
16 Answers IBM, Infosys, TCS,
When would you use a pointer to a function?
How can I swap two values without using a temporary?
How to find the digits truncation when assigning the interger variable to the character variables. like int i=500; char x = i : here we have truncation. how to find this. another ex: i =100; char x=i. here we do not have truncation.
Explain the concept and use of type void.