Powered by Blogger.

Monday, March 18, 2013

11.Print largest number using if and else in three input:

#include<stdio.h>
int main()
{
    int i,j,k;
    printf("Enter Any three number your choice:");
    scanf("%d%d%d",&i,&j,&k);
    if(i>j)
    {
        if(i>k)
        printf("\nThe largest number is %d\n",i);
        else
        printf("\nThe largest number is %d\n",k);
    }
    else
    {
        if(k>j)
        printf("\nThe largest number is %d\n",k);
        else
        printf("\nThe largest number is %d\n",j);
    }
}

0 comments:

Post a Comment