Search
 
SCRIPT & CODE EXAMPLE
 

C

to find greatest of 4 numbers in c

#include <stdio.h>

int main()
{
    int a, b, c, d;
    printf("enter four numbers:");
    scanf("%d %d %d %d", &a, &b, &c, &d);
    if (a > b)
    {
        if (a > c)
        {
            if (a > d)
            {
                printf("%d is greatest 
", a);
            }
        }
    }
    else
    {
        if (b > c)
        {
            if (b > d)
            {
                printf("%d is greatest 
", b);
            }
        }
        else
        {
            if (c > d)
            {
                printf("%d is greatest 
", c);
            }
            else
            {
                printf("%d is greatest 
", d);
            }
        }
    }

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: addition in c 
C :: how to open a website in c 
C :: mutex c 
C :: connect servo to arduino 
C :: how to check if a string pointer is empty in c 
C :: turn a char into an int in c 
C :: install tweaks ubuntu 
C :: multiplication table in c using array 
C :: bitwise operators in c 
C :: factorial of a number in c 
C :: 2 bytes integer c 
C :: c get current month, year, day 
C :: binary to decimal in c 
C :: c read file 
C :: c programming language 
C :: bootstrap form 
C :: Program to input and print array elements in c 
C :: declare variables arduino 
C :: delay in c programming for windows 
C :: C program for float division of numbers 
C :: faire une facture en langage c 
C :: chevront de vlavier 
C :: bcopy 
C :: c read binary file 
C :: what is the use of malloc in c 
C :: boolean operators in c++ 
C :: predefined macros 
C :: cyrildewit laravel page view counter package. 
C :: print in c 11111 00000 11111 00000 11111 
C :: can torch light bring change in chemical reaction 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =