Write a C# program to compute the sum of two given integers, if two values are equal then return the triple of their sum
- برمجة سي شارب
- برمجة
- 2021-05-15
- MarwaMohammed
الأجوبة
using System;
using System.Collections.Generic;
public class Exercise19 {
static void Main(string[] args)
{
Console.WriteLine(SumTriple(2,2));
Console.WriteLine(SumTriple(12,10));
Console.WriteLine(SumTriple(-5,2));
}
public static int SumTriple(int a, int b)
{
return a == b ? (a + b)*3 : a + b;
}
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
