Computer Science, asked by yasjjoshi5614, 10 months ago

Write a program to accept a number . Convert it in into year , months , weeks , days

Answers

Answered by Anonymous
0

Answer:

The Himalayas, or Himalaya is a mountain range in Asia, separating the plains of the Indian subcontinent from the Tibetan Plateau. The range has many of the Earth's highest peaks, including the highest, Mount Everest. The Himalayas include over fifty mountains exceeding 7,200 m (23,600 ft) in elevation, including ten of the fourteen 8,000-metre peaks. By contrast, the highest peak outside Asia (Aconcagua, in the Andes) is 6,961 m (22,838 ft) tall.

Lifted by the subduction of the Indian tectonic plate under the Eurasian Plate, the Himalayan mountain range runs west-northwest to east-southeast in an arc 2,400 km (1,500 mi) long. Its western anchor, Nanga Parbat, lies just south of the northernmost bend of Indus river. Its eastern anchor, Namcha Barwa, is just west of the great bend of the Yarlung Tsangpo River (upper stream of the Brahmaputra River). The Himalayan range on the northwest by the Karakoram and the Hindu Kush ranges. To the north, the chain is separated from the Tibetan Plateau by a 50–60 km (31–37 mi) wide tectonic valley called the Indus-Tsangpo Suture. Towards the south the arc of the Himalaya is ringed by the very low Indo-Gangetic Plain. The range varies in width from 350 km (220 mi) in the west (Pakistan) to 150 km (93 mi) in the east (Arunachal Pradesh). The Himalayas are distinct from the other great ranges of central Asia, although sometimes the term 'Himalaya' (or 'Greater Himalaya') is loosely used to include the Karakoram and some of the other ranges.

Answered by Shivu516
0

Answer: This program is in Java. I have not added weeks because days are easier to understand.

import java.util.Scanner;

public class DaysConverter {

   public static void main (String [] args) {

       Scanner sc = new Scanner(System.in);

       //Taking input from the user

       System.out.println("Here, a month is considered to have 30 day");

       System.out.print("Enter days: ");

       int days = sc.nextInt();

       

       //Most important part comes here

       int years = days/365;

       int months = (days % 365) / 30;

       int Days = (days % 365) % 30;

                       

       //Printing the output

       System.out.println("Year/s : " + years);

       System.out.println("Month/s : " + months);

       System.out.println("Day/s : " + Days);

   }

}

Output:

Here, a month is considered to have 30 days

Enter days: 1234

Year/s : 3

Month/s : 4

Day/s : 19

Similar questions