- Q 2 Write A Program In Assembly Language Using Mips Instruction Set That Reads A Start Year And End Year From The User 1 (44.06 KiB) Viewed 66 times
Q-2: Write a program in Assembly Language using MIPs instruction set that reads a Start Year and End Year from the user
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q-2: Write a program in Assembly Language using MIPs instruction set that reads a Start Year and End Year from the user
Q-2: Write a program in Assembly Language using MIPs instruction set that reads a Start Year and End Year from the user and prints all the years between Start and End year that are leap years. A leap year is a year in which an extra day is added to the Gregorian calendar. While an ordinary year has 365 days, a leap year has 365 days. A leap year comes once every four years. To determine whether a year is a leap year, follow these steps: 1. If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5. 2. If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4. 3. If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5. 4. The year is a leap year (it has 366 days). 5. The year is not a leap year (it has 365 days). The program should execute a loop starting from the Start to End year. In each iteration of the loop, you should check whether the year is a leap year or not. If the year is a leap year, print the year. Otherwise, go to the next iteration of the loop. Sample Input/Output: Enter Start Year: 1993 Enter Start Year: 1898 Enter Start Year: 2018 Enter End Year: 2014 Enter End Year: 1920 Enter End Year: 2030 1996, 2000, 2004, 2008, 2012 1904, 1908, 1912, 1916, 1920 2020, 2024, 2028