Program to perform different operations with input by user (C++)

Program to perform different operations

[xyz-ihs snippet=”Google-Adsense”]

-Program:

#include <stdio.h>
#include <conio.h>
void main()
{
[xyz-ihs snippet=”200-x-90″]
int a, b;
char op;
printf(“Enter first number:”);
scanf(“%d”, &a);
printf(“Enter second number:”);
scanf(“%d”, &b);
printf(“Enter operation such as + – or *”);
scanf(“%c”, &ch);
if (ch == ‘+’)
printf(“Addition = %d “, a+b);
else if (ch == ‘-‘)
printf(“Subtraction = %d”, a-b);
else if (ch == ‘*’)
printf(“Multiplication = %d”, a*b);
[xyz-ihs snippet=”200-x-90″]
else
printf(“Wrong choice!”);
}


“My posts/articles/images are not allowed to be stolen/copied anywhere at Cyber space. Doing so will allow me to take a legal action against the copier.”

Related Posts

Leave a Comment

Kindly solve the following puzzle to prove that you\'re not a bot: