Translate

Sunday, April 26, 2020

C Program to find the smallest number among three number

#include<stdio.h>

#include<conio.h>
void main()
{
     int a, b, c;
     
    printf("enter value in a = ");
    scanf("%d",& a);
    printf("enter value in b = ");
    scanf("%d",& b);
    printf("enter value in c = ");
    scanf("%d",& c);
    
if(a<b)
     {
         if(a<c)
              printf("\na is smallest %d", a);
           else
              printf("\nc is smallest %d", c);
     }
     else
     {
         if(b<c)
              printf("\nb is smallest %d",b);
           else
              printf("\nc is smallest %d",c);
     }
    getch();

}

Output:

No comments:

Post a Comment

C program to make a calculator using the switch statement.

/*perform arithmetic calculation on integers in C language*/ #include<stdio.h> #include<conio.h> void main() {     char op;     ...