Write a C# Sharp program to check if two given non-negative integers have the same last digit
- برمجة سي شارب
- برمجة
- 2021-05-16
- MarwaMohammed
الأجوبة
using System;
namespace exercises
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(test(123, 456));
Console.WriteLine(test(12, 512));
Console.WriteLine(test(7, 87));
Console.WriteLine(test(12, 45));
Console.ReadLine();
}
public static bool test(int x, int y)
{
return Math.Abs(x % 10) == Math.Abs(y % 10);
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
