2/21/2009

C Program To Find The Largest Of Three Numbers



    /*Write a c program to find the largest
              of three numbers  */
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,c;
    printf("Enter three numbers :\n");
        scanf("%d%d%d",&a,&b,&c);
      if (a>b&&a>c)
        printf("%d is largest\n",a);
      else if(b>a&&b>c)
        printf("%d is largest\n",b);
      else
        printf("%d is largest\n",c);
    return 0;
}
Out Put:
Enter three numbers :
652
845
254
845 is largest

No comments:

Post a Comment