Labassignment 2
Labassignment 2
Roll No: 37
Assignment No: 02
Title: Write a C++ program create a calculator for an arithmetic operator (+, -, *, /). The program
should take two operands from user and performs the operation on those two operands depending
upon the operator entered by user. Use a switch statement to select the operation. Finally, display the
result
PROGRAM:
#include<iostream>
float a, b;
char d;
cin>>a;
cin>>b;
cin>>d;
switch (d)
case '+':
break;
case '-':
break;
case '*':
case '/':
break;
default:
break;
return 0;
Output: