Posts

Showing posts with the label Coding Exercise

Coding Exercise 1

Image
 Coding Exercise 1: int a=4, 5,6,7 Int b=5, 90,31,44,20,32 Declare above array a and b Create 3rd array c which would have data of a and b In above question we can't use array list and sort method of collection. Java: import java.util.Arrays; public class copyonearraytoanother { public static void main(String[] args) { int a[]= {4,5,6,7}; int b[]= {5,90,31,44,20,32}; int[] mergedArray = new int[a.length+b.length];    //resultant array   //int c[]= {}; int pos=0; for(int ele : a) { mergedArray[pos]=ele; pos++; } for(int ele : b) { mergedArray[pos]=ele; pos++; } System.out.println(Arrays.toString(mergedArray)); } } Python: a=[4, 5,6,7] b=[5, 90,31,44,20,32] c=a+b print(c) Meet you in another Exercise!!

Coding challenges on Python and Java

Image
  Hello Guys!! As you aware these days to crack any Automation interview Java or Photon programming skill become mandatory and we are getting questions to write programs in the interview. So I will be posting two coding exercises per day. Solution will be given both in Java and Python. First try yourself without seeing the solution, this will improve your logical thinking. If you are not getting, its not an issue because making a century always starts with one run. So you can look at the solution, analyze and try yourself. See you in the next post!!!💬💬💥