C Programming

C program to find the largest number among three entered numbers

Write a program to take three integer number input from the user and find a greater number among them.

C Code

#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{

int a, b, c;

printf("enter three numbers:");
scanf("%d%d%d",&a,&b,&c);

if(a>=b && a>=c)
printf("%d is greater",a);
else if (b>=a && b>=c)
printf("%d is greater",b);
else
printf("%d is greater",c);

getch();
}

Output

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.