Search This Blog

Wednesday, July 27, 2011

minimum of 3 numbers


#include <stdio.h>

int
main (void)
{
   /* declarations */
   int a,b,c;
 
   printf ("Enter value of a: ");
   scanf ("%d", &a);
   printf ("You entered: %d\n", a );
 
   printf ("Enter value of b: ");
   scanf ("%d", &b);
   printf ("You entered: %d\n", b );

 printf ("Enter value of c: ");
   scanf ("%d", &c);
   printf ("You entered: %d\n", c );

if(a<b && a<c)
printf("a is lesser than b and c \n");
 else
  if(b<a && b<c)
printf("b is lesser than a and c \n");
else
if(c<a && c<b)
printf("c is lesser than a and b \n");

   return (0);
}

No comments:

Post a Comment