اكتب برنامج C لحساب مجموع قيمتي عدد صحيحين إذا كانت القيمتان متماثلتين ، فارجع بثلاثة أضعاف مجموعهما
- برمجة
- برمجة سي c
- 2021-05-03
- Wassim
الأجوبة
/*Write a C program to compute the sum of the two given integer values. If the two values are the same, then return triple their sum*/
#include <stdio.h>
int main(void){
printf("%d",test(1, 2));
printf("\n%d",test(2, 2));
}
int test(int x, int y)
{
return x == y ? (x + y)*3 : x + y;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال