Find minimum number

Sunday, June 20, 2010

// C08_Ex 5:Input 4 whole number a, b, c, d
// Find minimum number

#include <stdio.h>

void main()
{
    int a, b, c, d, min, max;
    printf("Input a, b, c, d: ");
    scanf("%d%d%d%d", &a, &b, &c, &d);
  
    min = a;
    if (b < min) min = b;
    if (c < min) min = c;
    if (d < min) min = d;

    printf("=> Minimum number: %d\n", min);

0 Comments:

Post a Comment

 
 
 
 
Copyright © 2010 C Source Code - C++ Source Code. All Rights Reserved. Using Xclear Theme | Bloggerized by Themescook Developed by Helios | Powered by Blogger