E
engaref
Hello Every body,
I am new with C programming.I have received the Problems from my
advisor on Array
but I did not find any Proper answer yet.
If Possible,please make a solution for the Problems.
Thanks
The Problems are as follows:
1-Declare an array of length of 10 and read integers into the elements
of array from keyboard(using Scanf).
Then exchange the preceding two elemnt of the array and print the
contents.
Out put Example:
1 2 3 4 5 6 7 8 9 10
2 1 3 4 5 6 7 8 9 10
2-Similear as above,but this time insert the first element of the array
into the fifth position and print the contents.
Output Ex:
1 2 3 4 5 6 7 8 9 10
2 3 4 5 1 6 7 8 9 10
3-Similear as above,but insert the first element of the array into the
position specified by a following integer and print the contents.
output Ex:
1 2 3 4 5 6 7 8 9 10
7
3 5 7 9 2 4 1 6 8 10
4-Declare an array of Length of 10 an read integers into the elements
of the array from keyboard.then read an integer which specifies the
number of repetition.
according to the repetition number,print the contents of the array.
Output Ex:
1 2 3 4 5 6 7 8 9 10
3
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
5- Declare a two-dimensional array "a" of size 10 by 10 and read 10
integers into a[0][0] to a[0][9].then repeat
insertion operation specified by an integers sequence nin times and
store the results from a[1] to a[9].
Finally,print the array.
I am new with C programming.I have received the Problems from my
advisor on Array
but I did not find any Proper answer yet.
If Possible,please make a solution for the Problems.
Thanks
The Problems are as follows:
1-Declare an array of length of 10 and read integers into the elements
of array from keyboard(using Scanf).
Then exchange the preceding two elemnt of the array and print the
contents.
Out put Example:
1 2 3 4 5 6 7 8 9 10
2 1 3 4 5 6 7 8 9 10
2-Similear as above,but this time insert the first element of the array
into the fifth position and print the contents.
Output Ex:
1 2 3 4 5 6 7 8 9 10
2 3 4 5 1 6 7 8 9 10
3-Similear as above,but insert the first element of the array into the
position specified by a following integer and print the contents.
output Ex:
1 2 3 4 5 6 7 8 9 10
7
3 5 7 9 2 4 1 6 8 10
4-Declare an array of Length of 10 an read integers into the elements
of the array from keyboard.then read an integer which specifies the
number of repetition.
according to the repetition number,print the contents of the array.
Output Ex:
1 2 3 4 5 6 7 8 9 10
3
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
5- Declare a two-dimensional array "a" of size 10 by 10 and read 10
integers into a[0][0] to a[0][9].then repeat
insertion operation specified by an integers sequence nin times and
store the results from a[1] to a[9].
Finally,print the array.