Back to School | Basic of Input/Output Problem | Hackerearth Solution

Back to School

Problem - 

                     In our school days, all of us have enjoyed the Games period. Raghav loves to play cricket and is Captain of his team. He always wanted to win all the cricket matches. But only one last Games period is left in school now. After that, he will pass out from school.
So, this match is very important to him. He does not want to lose it. So he has done a lot of planning to make sure his teams win. He is worried about only one opponent - Jatin, who is a very good batsman.
Raghav has figured out 3 types of bowling techniques, that could be most beneficial for dismissing Jatin. He has given points to each of the 3 techniques.
You need to tell him which is the maximum point value so that Raghav can select the best technique.
3 numbers are given in input. Output the maximum of these numbers.

Input:
Three space-separated integers.

Output:
Maximum integer value

SAMPLE INPUT
8 6 1 
SAMPLE OUTPUT
8








Explanation:
Out of given numbers, 8 is maximum.
                                      
--------------------------------------------------------------------------------------------------------------------------

Code in C language - 


#include<stdio.h>
void main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a>b)
    {
        if(a>c)
        {
            printf("%d",a);
        }
        else
        {
            printf("%d",c);
        }
    }
    else
    {
        if(b>c)
        {
            printf("%d",b);
        }
        else
        {
            printf("%d",c);
        }
    }
}

-----------------------------------------------------------------------------------------

My code is only for education purpose so use only an educational purpose and develop our skills in coding.

********** Please do not use it for another purpose.**********

--------------------------------------------------------------------------------------------------------------------------

Comments

Popular posts from this blog

Roy and Profile Picture hackerearth question solution

How to use Sort function in c++ language and sort the array element