Last Updated: 4 Feb, 2021

Largest of 3 numbers

Easy
Asked in company
BigDataLogin

Problem statement

Write a program that takes three numbers a,b, and c as input and prints the largest number amongst them.

Input Format:

The only line of input contains three space-separated integers.

Output Format:

The only line of the output prints the largest integer.

Approaches

01 Approach

Take input in 3 variables, a, b and c suppose.

Now,

if (a ≥ b  &&  a ≥ c ) print a 

else if ( b≥ a && b ≥ c) print b

else print c .