اكتب برنامج C للتحقق من عددين صحيحين ، كل منهما يقع في النطاق 10..99. ارجع صحيح إذا ظهر رقم في كلا العددين ، مثل 3 في 13 و 33
- برمجة
- برمجة سي c
- 2021-05-03
- Wassim
الأجوبة
/*Write a C program to check two given integers, each in the range 10..99. Return true if a digit appears in both numbers, such as the 3 in 13 and 33*/
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("%d",test(11, 21));
printf("\n%d",test(11, 20));
printf("\n%d",test(10, 10));
}
int test(int x, int y)
{
return x / 10 == y / 10 || x / 10 == y % 10 || x % 10 == y / 10 || x % 10 == y % 10;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال