Code In Tech - The Ultimate World of Computer Technology

Tuesday 27 March 2012

C progrm to Find maximum of three numbers

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c;
 clrscr();
 printf("Enter number A:");
 scanf("%d",&a);
 printf("Enter number B:");
 scanf("%d",&b);

 printf("Enter number C:");
 scanf("%d",&c);
 if(a>b)
 {
  if(a>c)
   {
    printf("\nA is maximum.");
   }
  else
   {
    printf("\nC is maximum.");
   }
 }
 else
 {
  if(b>c)
  {
  printf("\nB is maximum.");
  }
  else
  {
   printf("\nC is maximum.");
  }
 }
getch();
}

No comments :

Post a Comment