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 Ā  Ā  Ā  | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
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
5 Respostas
+ 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
+ 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
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
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
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