Code In Tech - The Ultimate World of Computer Technology

Saturday, 24 March 2012

C Program to Find the Maximum number

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