Click the Follow Button

C; Biggest b/w 3 numbers

 Program:

#include<stdio.h>

int main ()
{
    int a,b,c,big;
    printf("enter 1st number: ");
    scanf("%d", &a);
    printf("enter 2nd number: ");
    scanf("%d", &b);
    printf("enter 3rd number: ");
    scanf("%d", &c);

    if(a>b && a>c)
    big = a;
    if(b>a && b>c)
    big = b;
    if(c>b && c>a)
    big = c;
    printf("the biggest number is : %d", big);
    return 0;
}

Output:

enter 1st number: 23

enter 2nd number: 56

enter 3rd number: 78

the biggest number is : 78

Comments

Popular Posts

TIC - TAC - TOE

Prime and not prime number

do_while loop is to do something again and again