write a c program to find the largest of three numbers,write a c program to find the largest of 3 numbers,write a c program to find the largest of three given numbers,write a c program to find the greatest of three numbers,write a c program to find the greatest among the three given numbers,write a c program to find the greatest of 3 numbers,write a c program to find the greatest of three numbers using conditional operator,write a c program to find the largest of three numbers using ternary operator
Write a program to find the largest of three numbers in c
#include<stdio.h>
#include<conio.h>
void main()
{
int largest(int,int,int);
int a,b,c,large;
clrscr();
printf("Enter three numbers:\n");
scanf("%d%d%d",&a,&b,&c);
large=largest(a,b,c);
printf("Largest number is %d",large);
getch();
}
int largest(int x,int y,int z)
{
return(x>y?(x>z?x:z):(y>z?y:z));
}
Output:
Enter three numbers:
20
10
30
No comments: