Problem Description Link
let a, b and c are salaries and avg is medium salary that
we determine.
1. get input testcase
2. get input a, b, c
3.
if((b>a and b<c)||(b<a and b>c))
avg=b;
else if((c>a and c<b)||(c<a and c>b))
avg=c;
else
avg=a;
4.print the avg.
ALgorithm:
This problem determine the medium salary that not lowest or highest.let a, b and c are salaries and avg is medium salary that
we determine.
1. get input testcase
2. get input a, b, c
3.
if((b>a and b<c)||(b<a and b>c))
avg=b;
else if((c>a and c<b)||(c<a and c>b))
avg=c;
else
avg=a;
4.print the avg.
No comments:
Post a Comment
Write your comment - Share Knowledge and Experience