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
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
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
Math,
3 months ago
India Languages,
3 months ago
Math,
3 months ago
Computer Science,
6 months ago
Hindi,
6 months ago
English,
11 months ago
Math,
11 months ago
Math,
11 months ago