write a program for finding the union of two integer array
in java?

Answer Posted / nadeem khokhar

the above mentioned code is also good one. but i m giving you an algorithm you can say, so you can get the concept and convert it into any language
int a[3]=1,2,3;
int b[3]=2,3,4;

for(int i=0; i <=2; i++)
{

for(int j=0; j<=2; j++)
{

if(a[i] == b[j])
cout<<a[i]; is a union of a and b
}
}

Is This Answer Correct ?    14 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a shell program to test whether a given year is leap year or not ?

2265


in cobol,wat is the difference in using 'set index in occurs clause' ....and 'occurs depending-on clause'

1776


What is the difference between COM and CORBA?

730


In an customer exit (include Z) program, only the last record is getting fetched. The exit is getting called after pressing save button. What to write for fetching the first record ? Before saved to a SAP table how can i call all these records in an itab in the exit ?

1517


what are all the validation we need to perform in data stage?

1949






Define distributed queries. can you explain me as soon as possible

1628


How to get the index of the clicked field in reports in ABAP?

1164


what is the certificates in biztalk?

1432


Wrtite a JCL for sorting a file with start from 36 postion lenth 9 excluding a num eq to 98768. for 3 marks mainframe

1469


Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

763


How to merge Action Form with Dyna Action Form in Struts.

1896


Hello Experts, What is the difference between move and move corresponding exactly? please post me asap

1337


diffrence between oracle apps , .NET , SAP

1606


hi this is uday i want prepare for nic exam if any one have previous question papers please send me or atlest guide me how to prepare my ID is udaykiran4u@in.com

1477


give idea for creating screen in abap

1645