write a program in c to merge two array

Answer Posted / ashok kannan

#include<stdio.h>
void main()
{
int a[]={1,1,2,3,4,5},b[]={2,3,4,5,6};
int i,j;
for(i=0;a[i]!='\0';i++);

for(j=0;b[j]!='\0';j++)
{
a[i]=b[j];
i++;
}

for(i=0;a[i]!='\0';i++)
printf("%d",a[i]);

}

Is This Answer Correct ?    14 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1066


What is data _null_? ,Explain with code when u need to use it in data step programming ?

2819


could you please send the program code for multiplying sparse matrix in c????

3065


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2322


How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

1924






To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

489


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3024


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2136


3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

3317


How to palindrom string in c language?

8822


How can you relate the function with the structure? Explain with an appropriate example.

2915


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2401


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2016


how to test pierrot divisor

2253


Develop a routine to reflect an object about an arbitrarily selected plane

2990