Maximum of three Number

Monday, 29 August 2011

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter the value of a");
scanf("%d",&a);
printf("\nEnter the value of b");
scanf("%d",&b);
printf("\nEnter the value of c");
scanf("%d",&c);
if(a>b&&a>c)
 {
   printf("\na is greater");
 }
if(b>a&&b>c)
 {
   printf("\nb is greater");
 }
else
 {
   printf("\nc is greater");
 }
getch();
}

OUTPUT:

Enter the value of a 5
Enter the value of b 7
Enter the value of c 9
c is greater





No comments:

Post a Comment

 

Blogger news

Blogroll

Enter your email address:

Delivered by FeedBurner

Total Pageviews

Followers

Most Reading