Monday, March 26, 2012

Program to find greatest number among three numbers


/*****************<soeasyprograms.blogspot.in>******************/
 /* Program to find greatest number among three numbers*/

  #include<stdio.h>
  #include<conio.h>
  void main()
  {
    int a,b,c;
    clrscr();
    printf("Enter the value of three numbers\n");
    scanf(" %d %d %d",&a,&b,&c);
    if(a>b)
   {
     if(a>c)
    {
      printf("%d is greatest",a);
      }
     else
    {
      printf("%d is greatest",c);
      }
      }
 else
  {
    if(b>c)
    {
       printf("%d is greatest",b);
       }
    else
    {
       printf("%d is greatest",c);
       }
       }
    getch();
    }
  /*****************<soeasyprograms.blogspot.in>******************/

No comments:

Post a Comment