Filled Under:

C Program to Find the Largest Number Among Three Numbers

C Program to Find the Largest Number Among Three Numbers


C Program to Find the Largest Number Among Three Numbers

In this program I have discussed about the C Program to Find the Largest Number Among Three Numbers..

Here I have used the ternary operator (?) to solve the program.

---------------------------------------------------------------------

#include<stdio.h>
void main()
{ int a,b,c;
printf("Enter three numbers: ");
scanf("%d%d%d",&a,&b,&b);
int p=a>b?a:b;
int q=c>p?c:p;
printf("The large number is %d \n",q);
}

------------------------------------------------------------------------------------------------------------

Just copy and paste the program in your desired compiler (Dev C++ is more preferable) and run it.

Enjoy programming in C.

0 comments:

Post a Comment

 

Copyright 2020 Programming in C All Right Reserved