Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The bigger number of 3 numbers
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _4.The_bigger_number_of_3_numbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("num1 = ");
- int a = Int32.Parse(Console.ReadLine());
- Console.Write("num2 = ");
- int b = Int32.Parse(Console.ReadLine());
- Console.Write("num3 = ");
- int c = Int32.Parse(Console.ReadLine());
- int largest = 0;
- /*
- if (a >= b && a >= c)
- largest = a;
- else if (b >= a && b >= c)
- largest = b;
- else
- largest = c;
- */
- largest = a;
- if (b > largest)
- largest = b;
- if (c > largest)
- largest = c;
- Console.WriteLine("The lagest number is {0}", largest);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment