Pages

Tuesday, March 26, 2013

How to write C program to find biggest of 3 integers.

/*Below is the 'C' code to find the biggest of 3 numbers:*/

void main()
{

/* Declare the variables*/
 int a,b,c,big;

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

/* read the values for a,b,c*/
 scanf("%d %d %d",&a,&b,&c);

 big=a;

 if(b>big)
  big=b;

 if(c>big)
  big=c;

 Printf("Biggest of 3 integers is: %d", big);

}

No comments:

Post a Comment