i need code for sorting number using Declaring and manipulating Arrays. Passing arrays to the functions as parameters.


The objective of this assignment is to provide an on hand experience of:

o Declaring and manipulating Arrays.
o Passing arrays to the functions as parameters.


Problem Statement:

For this assignment, you are required to sort two arrays and find out the common elements between the two.

Design and Implementation:

You are required to make three functions named as:

1) input
This function will take the input of two set of values into two individual arrays (having 10 elements each).

2) sort
This function will take argument of the two input arrays (having 10 elements each), sort and display both the arrays in ascending order.

3) Common_elements

This function will take argument of the two input arrays, find out the common elements between two set of array elements (having 10 elements each) and display that.

Sample output:

The following prototypes for the respective functions can be used to implement the above mentioned problem:

void input();

void sort( int array1[] , int array2[] );

void common_elements( int array1[] , int array2[] );

Your output can be similar with the following:

Enter first set values:
2
1
3
5
6
4
10
9
7
8

Enter second set values:
11
10
8
9
7
6
12
13
14
15

First Array after sorting:

1
2
3
4
5
6
7
8
9
10

Second Array after sorting:
6
7
8
9
10
11
12
13
14
15


Common elements

6, 7, 8, 9, 10

i need code for sorting number using Declaring and manipulating Arrays. Passing arrays to the functions as parameters.


The objective of this assignment is to provide an on hand experience of:

o Declaring and manipulating Arrays.
o Passing arrays to the functions as parameters.


Problem Statement:

For this assignment, you are required to sort two arrays and find out the common elements between the two.

Design and Implementation:

You are required to make three functions named as:

1) input
This function will take the input of two set of values into two individual arrays (having 10 elements each).

2) sort
This function will take argument of the two input arrays (having 10 elements each), sort and display both the arrays in ascending order.

3) Common_elements

This function will take argument of the two input arrays, find out the common elements between two set of array elements (having 10 elements each) and display that.

Sample output:

The following prototypes for the respective functions can be used to implement the above mentioned problem:

void input();

void sort( int array1[] , int array2[] );

void common_elements( int array1[] , int array2[] );

Your output can be similar with the following:

Enter first set values:
2
1
3
5
6
4
10
9
7
8

Enter second set values:
11
10
8
9
7
6
12
13
14
15

First Array after sorting:

1
2
3
4
5
6
7
8
9
10

Second Array after sorting:
6
7
8
9
10
11
12
13
14
15


Common elements

6, 7, 8, 9, 10

Hey that's a long query. I can suggest site funducode.com. Its a site by Yashwant Kanetkar who has written plenty of books on C and C++. Perhaps you will get the solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.