Computer Science, asked by jagadeeshmahima25, 10 months ago

wap in java by using input steam method....plzz answer to the question fast​

Answers

Answered by SpaceWalker17
5

Answer:

JAVA PROGRAM USING INPUT STREAM READER

* To accept the number of days and display it after converting into number of years, months and days.

import java.io.*;

public class days

{

public static void main (String args[])

{

int a, b, c, y, d;

InputStreamReader read = new InputStreamReader(System.in);

BufferedReader in = new BufferedReader(read);

System.out.println("Enter the number of days");

a=Integer.parseInt(in.readLine());

y=a/365;

b=a%365;

c=b/30;

d=b%30

System.out.println("The no. of years="+y);

System.out.println("The no. of months="+c);

System.out.println("The no. of days="+d);

}

}

Hope this answer will help you...!!

Similar questions