Hindi, asked by dishamalhan325, 3 months ago

4.Wap to input time in seconds. Display time after converting them into hours, minutes and seconds.

I need the variable description of this Java programs plss help me asap
and don't spam plsss

Answers

Answered by Sweetoldsoul
10

Answer:

[NOTE: the following procedure is not in scanner class]

// To display time in hours minutes and seconds.

import java.io.* ;

import java.lang.*;

class time

{

public static void main(String args[]) throws IOException

{

int t, h, s, m;

InputStreamReader reader = new InputStreamReader( System.in);

BufferedReader input = new BufferedReader(reader);

System.out.println(" Enter time in seconds");

t = Integer.parseInt(input.readLine());

h = t/ 3600;

s = s % 3600;

m = s/ 60;

s = s % 60;

System.out.println(" The time is :-");

System.out.println(h+ "hours" +m+ " minutes" +s+ " seconds");

}

}

I'd have provided the output too but couldn't due to my "laptop failure".

________________

Hope this helps!

Answered by MangekyoSharingan344
1

Java is a widely used object-oriented programming language and software platform that runs on billions of devices, including notebook computers, mobile devices, gaming consoles, medical devices and many others. The rules and syntax of Java are based on the C and C++ languages

Similar questions