עליך להתחבר בכדי להוריד קבצים מהאתר
על מנת להבטיח שמשאבינו לא ינוצלו לרעה.
if (boolean expression 1) { statement 1; statement 2; … { else if(boolean expression 2) { statement 3; statement 4; … } else if(boolean expression 3) { statement 5; statement 6; … } |
1 : class Program
2 : {
3 : static void Main(string[] args)
4 : {
5 : int num;
6 : Console.WriteLine("Enter number between 1 to 100");
7 : num = int.Parse(Console.ReadLine());
8 : if (num < 1 || num > 100)
9 : Console.WriteLine("Invalid number");
10 : else if (num >= 90)
11 : Console.WriteLine("Big number");
12 : else if (num < 30)
13 : Console.WriteLine("Small number");
14 : else
15 : Console.WriteLine("Medium number");
16 : }
17 : }
1 : class Program
2 : {
3 : static void Main(string[] args)
4 : {
5 : Console.WriteLine("Enter month (1 - 12)");
6 : int month = int.Parse(Console.ReadLine());
7 : if (month < 1 || month > 12)
8 : Console.WriteLine("Error");
9 : else if (month == 1)
10 : Console.WriteLine("January");
11 : else if (month == 2)
12 : Console.WriteLine("February");
13 : else if (month == 3)
14 : Console.WriteLine("March");
15 : else if (month == 4)
16 : Console.WriteLine("April");
17 : else if (month == 5)
18 : Console.WriteLine("May");
19 : else if (month == 6)
20 : Console.WriteLine("June");
21 : else if (month == 7)
22 : Console.WriteLine("July");
23 : else if (month == 8)
24 : Console.WriteLine("August");
25 : else if (month == 9)
26 : Console.WriteLine("September");
27 : else if (month == 10)
28 : Console.WriteLine("October");
29 : else if (month == 11)
30 : Console.WriteLine("November");
31 : else
32 : Console.WriteLine("December");
33 : }
34 : }