Write a C++ program to check if y is greater than x, and z is greater than y from three given integers x,y,z

  • برمجة سي بلس بلس
  • برمجة

Write a C++ program to check if y is greater than x, and z is greater than y from three given integers x,y,z

Sample Output:

1 
1 
0

الأجوبة

#include <iostream>
 
using namespace std;

bool test(int x, int y, int z)
        {
            return x < y && y < z;
        }
        
        
int main() 
 {
  cout << test(1, 2, 3) << endl; 
  cout << test(4, 5, 6) << endl; 
  cout << test(-1, 1, 0) << endl; 
  return 0;      
}
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...