0

Triplet of three numbers (a,b,c) Output : 1 if they are either in strictly increasing (a>b>c) or decreasing (a<b<c) order      

Can anyone. Help me with this problem?

23rd Feb 2022, 5:25 PM
Pratham Yadav
5 ответов
+ 1
1)declare a,b,c 2) assign them via input 3) if( ( condition && condition ) || (condition && condition) ) output 1
23rd Feb 2022, 6:14 PM
Raul Ramirez
Raul Ramirez - avatar
+ 2
Pratham Yadav , it can be also done by sorting both data structures and then doing the comparison: tup1 = (1,3,2) tup2 = (2,1,3) if sorted(tup1) == sorted(tup2): <do something> ...
24th Feb 2022, 10:49 AM
Lothar
Lothar - avatar
0
Triplet of three numbers (a,b,c) Output : 1 if they are either in strictly increasing (a>b>c) or decreasing (a<b<c) order
28th Jan 2023, 2:33 PM
Kanishkaa S
Kanishkaa S - avatar
0
Given three integers a b and c, find if they are strictly increasing/decreasing or not.
30th Jan 2023, 2:19 PM
JYOTI CHAUDHARI
JYOTI CHAUDHARI - avatar
0
#include<stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); /*Hai Iam RS*/ if((a<b<c)||(a>b>c)) { printf("%d",1); } else { printf("%d",0); } return 0; }
31st Jan 2023, 3:31 PM
SURYAPRAKASH R
SURYAPRAKASH R - avatar