From ad43da5c8faf8c4cc579b22178408ede3175d328 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar <51372066+Saurabh70@users.noreply.github.com> Date: Mon, 19 Oct 2020 11:53:21 +0530 Subject: [PATCH 1/2] Update CONTRIBUTING.md Added my name and GitHub profile in contributors list. --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab2e91d..583c44f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,3 +25,5 @@ ADD YOUR NAME(Github handle) below-: - Paul Ogolla (paulzay) - Akash Singh (thethakursahab) - Harshita Raj (Harshita248) +- Saurabh Kumar(Saurabh70) + From b784a5a6fd5cf86348f51fb541cd8a6d249bbe55 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar <51372066+Saurabh70@users.noreply.github.com> Date: Mon, 19 Oct 2020 12:09:42 +0530 Subject: [PATCH 2/2] Create LargestSmallest_Number.java --- LargestSmallest_Number.java | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 LargestSmallest_Number.java diff --git a/LargestSmallest_Number.java b/LargestSmallest_Number.java new file mode 100644 index 0000000..c8dc2ee --- /dev/null +++ b/LargestSmallest_Number.java @@ -0,0 +1,98 @@ +import java.util.Scanner; + +public class assignment1 +{ + public static void main(String args[]) + { + Scanner sc= new Scanner(System.in); + + int r ; + int c; + int i; + int j; + //User Input Matrix + + System.out.println("Enter number of rows:"); + r= sc.nextInt(); + + System.out.println("Enter number of columns:"); + c= sc.nextInt(); + + System.out.println("Enter your elements:"); + int [][] matrix= new int[r][c]; + + for (i=0; i=max) + { + max=matrix[i][j]; + } + + } + System.out.println("Largest element in row"+" "+i+":"+max); + System.out.println("Smallest element in row"+" "+i+":"+min); + + + } + + System.out.println(); //for giving space between output of rows and columns + + //Finding largest and smallest element from the row + for (j=0; j=max1) + { + max1=matrix[i][j]; + } + + } + System.out.println("Largest element in column"+" "+j+":"+max1); + System.out.println("Smallest element in column"+" "+j+":"+min1); + + + } + + + + } + +}