-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasic.cpp
More file actions
28 lines (26 loc) · 802 Bytes
/
Copy pathbasic.cpp
File metadata and controls
28 lines (26 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<iostream>
using namespace std;
int main(){
float a,b;
cout<< "-----------------------------------" <<endl;
cout<< "----- Basic Calculator Part 1 -----" <<endl;
cout<< "-----------------------------------" <<endl;
cout<< "Enter first number:" <<endl;
cin>> a;
cout<< "Enter second number:" <<endl;
cin>> b;
float add=(a+b);
float sub=(a-b);
float mul=(a*b);
float div=(a/b);
cout<< "-----------------------------------" <<endl;
cout<< "Entered 1st no. is: "<< a <<endl;
cout<< "Enterd 2nd no. is: " << b <<endl;
cout<< "-----------------------------------" <<endl;
cout<< "Addition is : " << add <<endl;
cout<< "Subtraction is : "<< sub <<endl;
cout<< "Multiplication is : " << mul <<endl;
cout<< "Division is : "<< div <<endl;
cout<< "-----------------------------------"<<endl;
return 0;
}