Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace clase2
- {
- class Program
- {
- static void Main(string[] args)
- {
- //vars to use
- int a, b, c ,res;
- Boolean ban ;
- //Default values
- a = 0;
- b = 0;
- c = 0;
- ban = true;
- //Input
- Console.WriteLine("digite dato 1");
- a = int.Parse(Console.ReadLine());
- Console.WriteLine("digite dato 2");
- b = int.Parse(Console.ReadLine());
- //Operation
- do
- {
- Console.WriteLine("digite 1:SUM , 2:RESTA");
- res = int.Parse(Console.ReadLine());
- if(res == 1){
- c = a + b;
- ban = false;
- }else if(res == 2){
- c = a - b;
- ban = false;
- }
- } while (ban);
- //Output
- Console.Write("Resultado es : " + c);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement