Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class sommapari
- {
- static void Main()
- {
- int m = 2, n = 5, somma = 0;
- do
- {
- Console.WriteLine("Inserisci m: ");
- m = Convert.ToInt32(Console.ReadLine());
- }while(m<0);
- do
- {
- Console.WriteLine("Inserisci n: ");
- n = Convert.ToInt32(Console.ReadLine());
- }while(n<m);
- somma = m;
- while(m<n)
- somma += (++m);
- Console.WriteLine("La somma รจ: " + somma);
- Console.ReadKey();
- }
- }
Add Comment
Please, Sign In to add comment