Write a Java code to input height (in inches) and convert it into feet and inches.
Source
Code:-
import
java.io.*;
import
java.util.*;
class height
{
height()
{
int a,b,inch;
Scanner s=new
Scanner(System.in);
System.out.println("Enter
the Height in inches");
inch=s.nextInt();
a=inch/12;
b=inch%12;
System.out.println("The
height is "+a+" feet
"+b+" inches ");
}
public static void main(String arg[])
{
new height();
}
}
Output :-
Comments
Post a Comment