Computer Science, asked by mp857846, 3 months ago

8) Question 8. Write a program to find the
Smallest of 3 Digits.
Ex: - A=45 ,B=47, C=12
Output:- C is smallest

Answers

Answered by vijayghore
2

Answer:

#include<stdio.h>

void main()

{

  int a = 45, b = 47, c = 12;

  clrscr();

  if(a<b && a<c)

  {

      printf("A is smallest");

  }

  else if( b<a && b<c)

  {

     printf("B is smallest");

  }

  else

  {

      printf("C is smallest");

  }

  getch();

}

Answered by anindyaadhikari13
1

Question:-

Write a program to find the smallest of three numbers.

Program:-

class Smallest

{

public static void main(String s[])

{

int a=45,b=47,c=12;

int min=Math.min(a, Math.min(b, c));

System.out.println("Smallest Number is: "+min);

}

}

Similar questions