Thursday, 14 March 2013

C++ Get The Largest Number


#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)

{if(a>c)

printf("a is largest");

else

printf("c is largest");}

else

if(b>c)

printf("b is largest");

else

printf("c is largest");

getch();

}

No comments:

Post a Comment