Write a C# Sharp program to test if a given non-negative number is a multiple of 13 or it is one more than a multiple of 13
- برمجة سي شارب
- برمجة
- 2021-05-16
- MarwaMohammed
الأجوبة
using System;
using System.Linq;
namespace exercises
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(test(13));
Console.WriteLine(test(14));
Console.WriteLine(test(27));
Console.WriteLine(test(41));
Console.ReadLine();
}
public static bool test(int n)
{
return n % 13 == 0 || n % 13 == 1;
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال