C Programming Related Problem 05

Write down a C program Code which can determine the largest number from three numbers. 

Following Coding(Using else if Case)

#include <stdio.h>

int main ()

{

    int num1, num2, num3;

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

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

    if (num1 > num2  &&  num1 > num3)

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

    else if (num2 > num3   &&  num2  >  num1)

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

    else

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

        return 0;

}

Comments

Popular posts from this blog

Hajir Biriyani with recipes

Freelancing

Python Programming Language & Used for