To find the maximum of Three Numbers by using else if ladder

 Program:


#include<stdio.h>
#include<conio.h>
void main()
{
    int a, b, c, max;
    prinf("Enter any Three Numbers : ");
    scanf("%d%d%d", &a, &b, &c,);
    if(a>b && a>c)
        max=a;
    else if(b>c)
        max=b;
    else
        max=c;
    prinf("Maximum Value is : %d", max);
    getch();
}


Output:

Enter any Three Numbers : 10    20    30
Maximum Value is : 30


Next Topic        :  

Previous Topic :

No comments:

Post a Comment