Course Content
Week 6 Assignment Answers
0/3
Week 7 Assignment Answers
0/2
Week 8 Assignment Answers
0/2
Week 1 Assignment Answers
0/3
Week 2 Assignment Answers
0/3
Week 3 Assignment Answers
0/3
Week 4 Assignment Answers
0/3
Week 5 Assignment Answers
0/3
[Week 1-8] NPTEL Introduction to programming in C Assignment Answers 2024

Given three integers a b and c, find if they are strictly increasing/decreasing or not.

Input
——-
Triplet of three integers (a,b,c)

Output
———
You have to output 1 if they are either in strictly increasing (a>b>c) or decreasing (a<b<c) order.

Output 0, otherwise.Sample Test Cases

InputOutput
Test Case 11 4 61
Test Case 21 1 00
Test Case 31 -1 -41
Test Case 46 4 40
Test Case 555 55 550
Test Case 64 3 21
Test Case 71 2 10
Answer: 

#include <stdio.h>

int main(){
int a,b,c;
scanf("%d %d %d", &a, &b, &c);

if(((a>b) && (b>c))||((c>b) && (b>a))){
printf("1");
}
else{
printf("0");
}
return 0;

}
0% Complete