Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to find minimum and maximum number from user specified 3 numbers

Posted By: Debra Nelson     Category: C Programming     Views: 37185

Write a program to find minimum and maximum number from user specified 3 numbers

Code for Program to find minimum and maximum number from user specified 3 numbers in C Programming

        #include<stdio.h>
    #include<conio.h>
    void main()
    {
        int a,b,c;
        clrscr();
        printf("\n Please enter the value of A: ");
        scanf("%d",&a);
        printf("\n Please enter the value of B: ");
        scanf("%d",&b);
        printf("\n Please enter the value of C: ");
        scanf("%d",&c);
        if (a<b && a<c)
            printf("\n %d is Minimum which is value of A",a);
        elseif(b<a && b<c)
            printf("\n %d is Minimum which is value of B",b);
        else
            printf("\n %d is Minimum which is value of C",c);

        if (a>b && a>c)
            printf("\n\n %d is Maximum which is value of A",a);
        elseif(b>a && b>c)
            printf("\n\n %d is Maximum which is value of B",b);
        else
            printf("\n\n %d is Minimum which is value of C",c);

        getch();
    }

*********************** OUTPUT *************************************

    Please enter the value of A: 47

    Please enter the value of B: 25

    Please enter the value of C: 96
    
    25 is Minimum which isvalue of B

    96 is Minimum which isvalue of C


********************************************************************
  
Share: 



Debra Nelson
Debra Nelson author of Program to find minimum and maximum number from user specified 3 numbers is from Baltimore, United States.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!