1. Engineering
  2. Electrical Engineering
  3. what is the function of following c code draw the...

Question: what is the function of following c code draw the...

Question details

What is the function of following C code, draw the flow chart for this program :

#include <stdio.h>

void main()

{

    int num1, num2, num3;

    printf("Enter the values of num1, num2 and num3\n");

    scanf("%d %d %d", &num1, &num2, &num3);

    printf("num1 = %d\tnum2 = %d\tnum3 = %d\n", num1, num2, num3);

    if (num1 > num2)

    {

        if (num1 > num3)

        {

            printf("num1 is the greatest among three \n");

        }

        else

        {

            printf("num3 is the greatest among three \n");

        }

    }

    else if (num2 > num3)

        printf("num2 is the greatest among three \n");

    else

        printf("num3 is the greatest among three \n");

}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution