Friday, September 3, 2010

C Program to find the largest number between three numbers

#include<stdio.h>
#include<conio.h>


void main()
{
     int a,b,c;
     clrscr();
     printf("\n\n Enter the values of three numbers \n\n");
     scanf("%d%d%d",&amp;a,&amp;b,&amp;c);
     printf("\n The values of three numbers are \n");
     printf(" a = %d\n",a);
     printf(" b = %d\n",b);
     printf(" c = %d\n",c);
     if(a&gt;b)
     {
        if(a&gt;c)
          printf("\ta = %d is larger ",a);
        else
          printf("\tc = %d is larger ",c);
     }
     else
     {
         if(c&gt;b)
            printf("\tc = %d is larger",c);
         else
            printf("\tb = %d is larger",b);
     }
     getch();
}

No comments:

Post a Comment