6.Greater among 4 value

 #include<stdio.h>

// to find greater number among four numbers
int main(){
    int a,b,c,d,great1=0,great2=0;
    printf("Enter any four numbers :");
    scanf("%d %d %d %d",&a,&b,&c,&d);
    if(a>b)
    great1=a;
    else
    great1=b;
    if(c>d)
    great2=c;
    else
    great2=d;
    if(great1>great2)
    printf("%d is greater\n",great1);
    else
    printf("%d is greater\n",great2);


    return 0;
}

Comments