প্রথমে তিনটি সংখ্যা সেট করুন:
int num1 = 10, num2 = 20, num3 = 50;
এখন প্রথম সংখ্যাকে দ্বিতীয় সংখ্যার সাথে তুলনা করুন। যদি num1 > num2 হয়, তবে num1 কে num3 এর সাথে তুলনা করুন। যদি num1 > num3 হয়, তবে num1 সবচেয়ে বড়।
সম্পূর্ণ উদাহরণ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
int num1 = 10, num2 = 20, num3 = 50;
if (num1 > num2) {
if (num1 > num3) {
Console.Write("Number one is the largest!\n");
} else {
Console.Write("Number three is the largest!\n");
}
} else if (num2 > num3) {
Console.Write("Number two is the largest!\n");
} else {
Console.Write("Number three is the largest!\n");
}
}
}
}
আউটপুট
Number three is the largest!