#include<stdio.h>
void main()
{
int a[5],b[5];
int c[10];
int i,j,temp,k;
printf("\n enter the elements of array A:=\n");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
printf("\n enter the elements of array B:=\n");
for(i=0;i<5;i++)
scanf("%d",&b[i]);
for(i=1;i<5;i++)
{
for(j=0;j<5-i;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
for(j=0;j<5-i;j++)
{
if(b[j]>b[j+1])
{
temp=b[j];
b[j]=b[j+1];
b[j+1]=temp;
}
}
}
printf("\n the elements of the array A:=\n");
for(i=0;i<5;i++)
printf("%d\t",a[i]);
printf("\n the elements of the array B:=\n");
for(i=0;i<5;i++)
printf("%d\t",b[i]);
i=0,j=0,k=0;
while(i<5&&j<5)
{
if(a[i]>b[j])
c[k++]=b[j++];
if(a[i]<b[j])
c[k++]=a[i++];
}
if(i<5&&j==5)
while(i<5)
c[k++]=a[i++];
if(i==5&&j<5)
while(j<5)
c[k++]=b[j++];
printf("\n the elements of the sorted merged array C:=\n");
for(i=0;i<10;i++)
printf("%d\t",c[i]);
}
#include <stdio.h>
int main ()
{
int a[10],b[10],c[20];
int k,i,j;
i=0;
printf("Please enter first 10 digits: ");
while (i<10)
{
scanf("%d", &a[i]);
i++;
}
printf("Please enter second 10 digits: ");
k=0;
while (k<10)
{
scanf("c%d",&b[k]);
k++;
}
j=0;
while (j<10)
{
c[j]=a[i];
j++;
}
while (j<20)
{
c[j]=b[k];
j++;
}
j=0;
while(j<20)
{
printf("%d\n", c[j]);
}
return 0;
}
#include<stdio.h>
void main()
{
int a[10],b[10],c[20],i,n
printf("enter the no of element in the array a[10],b[10]");
scanf("%d",&n);
printf("enter the element in the array a[10],b[10]");
scanf("%d%d",&a[i],&b[i]) ;
for(i=0;i<=10;i++)
{
c[i]=a[i]+b[i];
}
for(i=0;i<=10;i++)
{
printf("the array is %d",c[i]);
}
}
#include<stdio.h> main() { printf("\n I am newer to C language"); }
iiljp'
kpljop]\\
nkij
\nhj\
you need to use ar3=*(ar1)+*(ar2)
where ar3 is sum array while ar1 and ar2 are input array.
jjk,
In merge sort the whole is divided into two sub arrays. (This way of solving problem is called Divide and conquer algorithm) These sub arrays are called auxiliary arrays. First an array A is divided into two auxiliary arrays A1 and A2. Now these auxiliary arrays are further divided until we reach a stage with an auxiliary array of 2 elements. These 2 elements are arranged in incremental order and merged with the previous divided arrays. So we can say that auxiliary array is used to implement the basic principle of merge sort.
distinguish extra element in two arrays
for arrays you can list the different arrays and what attributes that you give to them.
Two dimensional arrays.
#include<stdio.h>
In merge sort the whole is divided into two sub arrays. (This way of solving problem is called Divide and conquer algorithm) These sub arrays are called auxiliary arrays. First an array A is divided into two auxiliary arrays A1 and A2. Now these auxiliary arrays are further divided until we reach a stage with an auxiliary array of 2 elements. These 2 elements are arranged in incremental order and merged with the previous divided arrays. So we can say that auxiliary array is used to implement the basic principle of merge sort.
distinguish extra element in two arrays
for arrays you can list the different arrays and what attributes that you give to them.
I assume you mean that you have a number of rows, and that not all rows have the same number of "cells". Yes, in Java a two-dimensional array is implemented as an array of arrays (each item in the top-level array is, in itself, an array); a 3-dimensional array is an array of arrays of arrays, etc.; and there is no rule stating that all secondary (etc.) arrays must have the same number of elements.
name two smaller arrays you can use to find the product
The way that you can merge two businesses is that the two business owners need to agree on a merge and its price. This must then be taken up with the government. The Government will then agree or disagree on the whole merge. GCSE BUSINESS ANSWER There are two types of merge in business 1. Friendly 2. Hostile
WAP devices generally cache WML checks. This is to reduce the time that is wasted in trying to reload a page that has been loaded earlier. However for dynamic content this is not a good feature- the user may be reading some state information from the cache. Two uses:- Caching by proxy servers caching by wap devices Radha M.Sc(IT)
The inherit function `array_dif($arrayOne, $arrayTwo, $arrayThree, ...)` is likely what you're looking for. It compares two or more arrays, and returns an array of values that are unique among the arrays.
When two tornadoes merge, it is just called merging; there is no special term.
You can't. While a string is a character array, an array is not necessarily a string. Treating arrays as if they were strings simply to swap them is madness. The correct way to physically swap arrays A and B is to copy A to a new array, C, then copy B to A, then C to B. If the arrays are the same size this is not a problem. If they are different sizes, you can only swap them if they are dynamic (not static). This means you must reallocate them. To speed up the process, copy the smallest array to C, first. A much better approach would be to point at the two arrays and swap the pointers instead.
He wanted to merge rock and jazz.
http://www.assignmentsclub.com/