Write a C# Sharp program to swap a two digit given number and check whether the given number is greater than its swap value
- برمجة سي شارب
- برمجة
- 2021-05-15
- MarwaMohammed
الأجوبة
using System;
using System.Linq;
namespace exercises
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Input an integer value:");
int n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Check whether the said value is greater than its swap value: " + test(n));
}
public static bool test(int n)
{
return (int)(n / 10) >= n % 10;
}
}
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال