/*
* 1000+ C programs + tutorials
*
*
* 37_find_greatest_number_among_3.c
*
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include
//#include
void main() {
int n1,n2,n3;
int max_no;
// clrscr();
printf("C Program to Find Greatest Number amound 3 Entered Number");
printf("\n\n Enter Number 1: ");
scanf("%i", &n1);
printf("\n\n Enter Number 2: ");
scanf("%i", &n2);
printf("\n\n Enter Number 3: ");
scanf("%i", &n3);
//Logic to find Greatest Number
max_no = n1;
(max_no < n2) && (max_no = n2);
(max_no < n3) && (max_no = n3);
printf("\n\n Greatest among Numbers %i,%i and %i : %i",n1,n2,n3, max_no);
// getch();
}
-
Output :
C Program to Find Greatest Number amound 3 Entered Number
Enter Number 1: 4
Enter Number 2: 5
Enter Number 3: 1
Greatest among Numbers 4,5 and 1 : 5
The best way to learn C programming is to practice more and more of programs .
Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.
BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.