Q-26- Write a java program to input the height of the person and check if the height of the person is greater than or equal to 6 feet then print the message “The person is tall”.
INPUT :
import java.util.Scanner;
public class NCM {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc =new Scanner(System.in);
double height;
System.out.println("Enter The Height Of The Person In Feet :");
height=sc.nextDouble();
if(height>=6)
{
System.out.println("The Person Is Tall.");
}
else
{
System.out.println("Mummy Ne Complan Nahin Pilaya.....");
}
}
}
OUTPUT :
Enter The Height Of The Person In Feet :
6
The Person Is Tall.
INPUT :
import java.util.Scanner;
public class NCM {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc =new Scanner(System.in);
double height;
System.out.println("Enter The Height Of The Person In Feet :");
height=sc.nextDouble();
if(height>=6)
{
System.out.println("The Person Is Tall.");
}
else
{
System.out.println("Mummy Ne Complan Nahin Pilaya.....");
}
}
}
Enter The Height Of The Person In Feet :
6
The Person Is Tall.
Enter The Height Of The Person In Feet :
5.9
Mummy Ne Complan Nahin Pilaya.....
No comments:
Post a Comment