Now let's do a length conversion from kilometers to meters.
This program allows the user to input the value in kilometer and the program returns its value in meter.
import java.util.Scanner;
public class KmToM {
public static void main(String[] args) {
int m = 1000;
System.out.println("Enter Kilometer: ");
double km;
Scanner reader = new Scanner(System.in);
km = reader.nextDouble();
double kmtometer=km*m;
System.out.println( km+ " kilometers is " +kmtometer+ " in meters");
}
}
Here's the output:
This program allows the user to input the value in kilometer and the program returns its value in meter.
import java.util.Scanner;
public class KmToM {
public static void main(String[] args) {
int m = 1000;
System.out.println("Enter Kilometer: ");
double km;
Scanner reader = new Scanner(System.in);
km = reader.nextDouble();
double kmtometer=km*m;
System.out.println( km+ " kilometers is " +kmtometer+ " in meters");
}
}
Here's the output:
I need this same question in loop
ReplyDeleteHi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me. I am a regular follower of your blog.
ReplyDeleteReally very informative post you shared here. Kindly keep blogging.
Java training in Btm layout
Java training in Rajaji nagar
Java training in Kalyan nagar
Java training in Kalyan nagar
Java training in Jaya nagar
170 neyin numarası
ReplyDelete170 nerenin numarası
cumartesi kuyumcular kaça kadar açık
tik tok takipçi arttirma hilesi ücretsiz telefon numarasız
balıkesir token
sivas token
smm panel
ReplyDeleteSMM PANEL
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
Servis
tiktok jeton hilesi
kartal bosch klima servisi
ReplyDeleteümraniye bosch klima servisi
ümraniye arçelik klima servisi
beykoz mitsubishi klima servisi
üsküdar lg klima servisi
tuzla lg klima servisi
çekmeköy bosch klima servisi
kadıköy mitsubishi klima servisi
ümraniye vestel klima servisi