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;
- namespace InputExit_zad10
- {
- class InputZad10
- {
- static void Main(string[] args)
- {
- Console.Write("enter nomber : ");
- int a = int.Parse(Console.ReadLine());
- int sum;
- Console.WriteLine("Do you want to enter a new number.");
- Console.Write("If you want, press '1', if not-another number :");
- int choice = int.Parse(Console.ReadLine());
- while (choice == 1)
- {
- Console.Write("enter nomber: ");
- int b = int.Parse(Console.ReadLine());
- a += b;
- sum = a;
- Console.WriteLine();
- Console.WriteLine("sum = " + sum);
- Console.WriteLine();
- Console.WriteLine("Do you want to enter a new number.");
- Console.Write("If you want, press '1', if not-another number :");
- choice = int.Parse(Console.ReadLine());
- }
- sum = a;
- Console.WriteLine("sum =" + sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement