This is a Java program that calculates the number of days between two years. It prompts the user to enter a start year and an end year, and then it calculates the number of days in each year between the start and end years. The program consists of three methods:
Overall, this program is a simple implementation of a common problem in programming - calculating the number of days between two dates. It uses basic Java syntax and concepts, such as methods, loops, conditionals, and user input.
import java.util.Scanner; public class Read_Print { public static void main(String args[]) { Scanner input = new Scanner(System.in); int a[][] = new int[100][100]; int row, col, i, j; System.out.print("Enter Number of Rows : "); row = input.nextInt(); System.out.print("Enter Number of Columns : "); col = input.nextInt(); for (i = 0; i < row; i++) { for (j = 0; j < col; j++) { System.out.printf("Enter Array Elements a[%d][%d] :",i,j); a[i][j] = input.nextInt(); } } System.out.println("Display 2D Array Element is : "); for (i = 0; i < row; i++) { for (j = 0; j < col; j++) { System.out.print(a[i][j] + " "); } System.out.println(); } } }
Enter Number of Rows : 2 Enter Number of Columns : 3 Enter Array Elements a[0][0] :1 Enter Array Elements a[0][1] :2 Enter Array Elements a[0][2] :3 Enter Array Elements a[1][0] :4 Enter Array Elements a[1][1] :5 Enter Array Elements a[1][2] :6 Display 2D Array Element is : 1 2 3 4 5 6
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions