0% found this document useful (0 votes)
12 views2 pages

3 Java Interchange The Elements of An Array Description

Uploaded by

infrontbeing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

3 Java Interchange The Elements of An Array Description

Uploaded by

infrontbeing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

11/12/2020 3 Java Interchange the elements of an array Description

 Priyadarshi Mrinal .

 Dashboard / Java / Arrays and Strings / Interchange the elements of an array

Description Code Editor Grading view

Interchange the elements of an array

Write a Java program to interchange the elements of an array with the elements of another array without using the third array.If the array size differs display "Unable to
swap size differs".If the range is lesser or equal to Zero . Display "Invalid range "

Assume the maximum size of array is 20

Sample Input 1:
Enter the number of elements in the rst array :
3
Enter the elements in the rst array
1
2
3
Enter the number of elements in the second array :
3
Enter the elements in the second array
4
5
6

Sample Output 1:
The rst array after swapping is :
456
The second array after swapping is :
123

Sample Input 2:

Enter the number of elements in the rst array :

-3

Sample Output 2:

Invalid range

Sample Input 3:

Enter the number of elements in the rst array :

Enter the elements in the rst array

Enter the number of elements in the second array :

Sample Output 3:

Unable to swap size differs

User Notes

https://accenturelearning.tekstac.com/mod/vpl/view.php?id=992 1/2
11/12/2020 3 Java Interchange the elements of an array Description

Add a note...  Priyadarshi Mrinal .

Press Enter to save

   

Powered by Tekstac

https://accenturelearning.tekstac.com/mod/vpl/view.php?id=992 2/2

You might also like