Java programming for beginners
رفتن به کانال در Telegram
Learn java programming through quizzes and videos
نمایش بیشترکشور مشخص نشده استدسته بندی مشخص نشده است
2 941
مشترکین
اطلاعاتی وجود ندارد24 ساعت
اطلاعاتی وجود ندارد7 روز
اطلاعاتی وجود ندارد30 روز
آرشیو پست ها
This video is very important for freshers, and non CS IT students
Because this will be asked in interview
Kunal Gupta welcome to the group. To learn how to crack coding exams
J Prashanth welcome to the group. To learn how to crack coding exams
Royal Challenge 22 Com In a town, there are N straight roads, with M houses on each road. Each house has a certain number of persons. Neighbours to particular house are next door houses, opposite houses and diagonal houses. 01: 28 DeverMan java DriverMain.java O Write a function to calculate the house with the highest number of neighbours and return the number of neighbours. The input to the function is N and M and the matrix of number representing persons in each house. <>> entryport.c 1'mport java.io.*; 2 mport java.util.*, 3 4 /Your program will be evaluated by this bri Input: 5 Public class DriverMain ( 6. 4-> Number of roads 7-> Number of houses on each road 1234567-> Number of persons in each house on road 1 1234567-> Number of persons in each house on road 1 1234567> Number of persons in each house on road 1 1234567-> Number of persons in each house on road 1 public static void main(String[] args) { Scanner = new Scanner (System.in); 7 8 int M = 3.nextInt (); 9 int Ns.nextInt (); 10 11. Input supplied as: 7 1234567 1234567 1234567 1234567 12 13 int A[] [] = new int [M] [N]; for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { A[i][j] =s.nextInt (); 14. 15 Output: 48 16 } 17 18 Explanation: The house located on 2nd road and 6th column of the matrix has neighbouring houses with 5, 5, 5, 6, 6, 7, 7, 7 persons respectively. So their sum le. 5+5+5+6+6+7+7+7=48 and it's the house with maximum number of neighbors. Hence, the output returned is 48.
