
This program takes 3 numbers and finds the largest one. To do this we will compare the numbers with each other and find the largest
Input: a=2,b=4,c=7 Output:7 Largest Number
This program uses only if statement to find the maximum number.
#includeusing namespace std; int main() { int a,b,c; a=2,b=4,c=7; if(a>b) { if(a>c) { printf("%d Largest Number ",a); } else { printf("%d Largest Number ",c); } } else { if(b>c) { printf("%d Largest Number ",b); } else { printf("%d Largest Number ",c); } } return 0; }
The above is the detailed content of C program: find the largest number among three numbers. For more information, please follow other related articles on the PHP Chinese website!
What does Douyin sw prompt sound mean?
Introduction to service providers with cost-effective cloud server prices
How to find the greatest common divisor in C language
How to change 3dmax to Chinese
How to sum three-dimensional arrays in php
pdf to xml format
Introduction to screenshot shortcut keys in Windows 7 system
border-collapse