google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a c program to find the largest of three numbers - 2nd puc computer science

Write a c program to find the largest of three numbers

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                                                                             

Largest number is 30                                                            
Write a c program to find the largest of three numbers Write a c program to find the largest of three numbers Reviewed by Vision Academy on December 13, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.