(C++) CPP Programs - 1

Friday, December 14, 2007

1. Write a C program to find biggest of 3 numbers.

/*biggest of three numbers*/

#include

#include

void main()

{

int a,b,c,big;

clrscr(); //clears the screen

printf("Enter the values for a,b,c,\n\a");

scanf("%d%d%d",&a,&b,&c);//3 inputs

if((a>b)&&(a>c)) // checks whether a is greater

printf("%d is the biggest of the three\n\a",a);

else if((b>a)&&(b>c)) //checks whether b is greater

printf("%d is the biggest of the three\n\a",b);

else //c is greater

printf("%d is the biggest of the three\n\a",c);

getch();

}

0 comments:

Post a Comment

Chitika

About This Blog

Followers

Blog Archive

  © Blogger template The Professional Template II by Ourblogtemplates.com 2009

Back to TOP