Requirement
Inconsistent Marks
Inconsistent Marks
Dr.Anoop has recently joined your institution as 'Dean-Student Affairs'. Dr.Anoop is an expert in Data Analytics and he always likes working with data.
He asked the class advisors of 4th semester students to submit the list of students who have scored marks in an inconsistent pattern in the first 3 semesters.
If the marks scored by the students are in non-increasing order in the 1st 3 semesters or if the marks scored by the students are in non-decreasing order in the 1st 3 semesters, their marks are in a consistent pattern.
Given the marks scored by a student in the first 3 semesters, can you help the class advisors in identifying whether it is in inconsistent pattern?
Input and Output Format:
Input consists of 3 integers corresponding to the marks scored by a student in his 1st semester, 2nd semester and 3rd semester.
Output consists of a string that is either yes or no. Output yes if the marks are in a inconsistent pattern.
Sample Input 1:
90
87
92
Sample Output 1:
yes
Sample Input 2:
90
91
98
Sample Output 2:
no

Option 2 - 90 91 98
Option 3 - 21 45 54
Input 4 - 1 0 -1 ANS
He asked the class advisors of 4th semester students to submit the list of students who have scored marks in an inconsistent pattern in the first 3 semesters.
If the marks scored by the students are in non-increasing order in the 1st 3 semesters or if the marks scored by the students are in non-decreasing order in the 1st 3 semesters, their marks are in a consistent pattern.
Given the marks scored by a student in the first 3 semesters, can you help the class advisors in identifying whether it is in inconsistent pattern?
Input and Output Format:
Input consists of 3 integers corresponding to the marks scored by a student in his 1st semester, 2nd semester and 3rd semester.
Output consists of a string that is either yes or no. Output yes if the marks are in a inconsistent pattern.
Sample Input 1:
90
87
92
Sample Output 1:
yes
Sample Input 2:
90
91
98
Sample Output 2:
no
#include < stdio . h >
int main()
{
int a,b,c;
scanf (" %d % d % d", & a & b , & c );
if ( (a > b & & a > c) & & (b > c & & b ) )
{
printf("\nyes");
}
else
{
printf("\nno");
}
return 0;
}
Option 1 - 2 2 1
Option 2 - 90 91 98
Option 3 - 21 45 54
Input 4 - 1 0 -1 ANS

No comments: