Header Ads Widget

C program to find the maximum among three numbers

 C program to find the maximum among three numbers 

Given three numbers , write a program to find the maximum among these numbers .

Sample input:

5  4 7

Sample output:

7 is maximum

 C program to find the maximum among three numbers 

The objective of the code is to find the maximum among three numbers given by user .

Code(C):-

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

Output:-

5
4
7
7 is maximum

Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-

Post a Comment

0 Comments