اكتب برنامج C يقبل زوجًا من الأرقام من المستخدم ويطبع "ترتيبًا تصاعديًا" إذا كان الرقمان بترتيب تصاعدي ، وإلا يطبع "ترتيب تنازلي"
- برمجة
- برمجة سي c
- 2021-05-02
- Wassim
الأجوبة
/*Write a C program that accepts a pair of numbers from the user and prints "Ascending order" if the two numbers are in ascending order, otherwise prints, "Descending order"*/
#include <stdio.h>
int main () {
int a, b;
printf("Input two pairs values (integer values):\n");
scanf("%d %d", &a, &b);
if (a != b)
{
if (b > a)
{
printf("Ascending order\n");
}
else
{
printf("Descending order\n");
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال