-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
34 lines (25 loc) · 687 Bytes
/
main.cc
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
29
30
31
32
33
34
#include<iostream>
int main (){
int opc = 0;
float number1 = 0;
float number2 = 0;
float number3 = 0;
std::cout<<"que operacion desea realizar:\n"<<"1-suma.\n"<<"2-resta.\n"<<std::endl;
std::cin>>opc;
std::cout<<"ingrese el primer numero: "<<std::endl;
std::cin>>number1;
std::cout<<"ingrese el segundo numero: "<<std::endl;
std::cin>>number2;
switch (opc)
{
case 1:
number3 = number1 + number2;
std::cout<<"la suma es: "<<number3;
break;
case 2:
number3 = number1 - number2;
std::cout<<"la resta es: "<<number3;
break;
}
return 0;
}