Math, asked by sucharita63, 11 months ago

write a C program to find the smallest number among three numbers using nested if else statement.

Answers

Answered by poojan
5

C Program to find the smallest of the three distinct numbers.

Program: (Dynamic)

#include <stdio.h>

int main()

{

int num1,num2,num3;

scanf("%d %d %d",&num1,&num2,&num3);   //Reading 3 integer values

if(num1<num2)

{

       if(num1<num3)

       {

        printf("%d is the smallest one among [%d, %d, %d]", num1, num1, num2, num3);

       }

       else

       {

           printf("%d is the smallest one among [%d, %d, %d]", num3, num1, num2, num3);

       }

   }

   else

   {

       if(num2<num3)

       {

        printf("%d is the smallest one among [%d, %d, %d]", num2, num1, num2, num3);

       }

       else

       {

           printf("%d is the smallest one among [%d, %d, %d]", num3, num1, num2, num3);

       }

   }

   return 0;

}

Input:

72 89 64

Output:

64 is the smallest one among [72, 89, 64]

Learn more:

1. Below is the list of various types of application software:   A. Database  B. Desktop publishing...

brainly.in/question/21118142

2. ________ allows showing the values of the measured field which decides the size of the circles

https://brainly.in/question/21100154

Answered by Anonymous
4

Answer:

\begin{gathered}\boxed{\begin{array}{cccc}\bf x &amp; \bf y \\ \frac{\qquad \qquad \qquad \qquad}{} &amp; \frac{\qquad \qquad \qquad \qquad}{} \\ \sf 0 &amp; \sf - 2.5 \\ \\ \sf 5 &amp; \sf 0 \end{array}} \\ \end{gathered}

Similar questions