Mock Questions
Mock Questions
11. Write a program to copy the elements of one array into another array
15. Write a program to insert New value in the array (sorted list )
16. Write a program to sort an array and print the count of unique elements in the array.
17. Write a program to print the sum of unique elements from an array
18. Write a program to delete all the multiples of 5 in an array.
20. How do you find the duplicate number on a given integer array
21. Write a program to delete two elements after the occurrence of a prime number and
22. Write a program to sort an array and print the count of ‘1’ in the array.
23. In an array, replace all the prime numbers with ‘ * ‘ & remove all the odd numbers.
24. Sort the array and replace elements in an odd position with * and remove prime
numbers
< 50.
27. Write a program to count even and odd numbers in an array and also print the sum of
28. How do you find all pairs of an integer array whose sum is equal to a given number?
29. Write a program to delete two elements after the occurrence of a prime number and
31. Sort the array and replace elements in an odd position with * and remove prime
numbers
32. Write a program to read n number of values in an array and display the array after
34. Write a program to sort an array and print the count of ‘1’ in the array.
35. Write a program to delete two elements after the occurrence of an even number
36. Write a program to find array elements that repeat 2 times in the array.
38. Write a program to merge two arrays of the same size sorted in descending
order.
41. Write a program to separate odd and even integers in separate arrays.
42. Write a program to insert New value in the array (sorted list ).
43. Write a program to insert New value in the array (unsorted list ) in (specific
position).
*
***
*
***
***
*
***
***
***
*
***
***
***
***
* *
* *
* *
**
*
**
* *
* *
* *
**
*
****
*
*
*
********
*
*
*
*
*
***
*
*
*
******
******
*
*
*
*********
*********
*********
*
*
***
**
**
******
***
***
*********
18.Write a program to print the following number pattern.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
I
IN
IND
INDI
INDIA
M
MA
MAL
MALA
MALAY
MALAYA
MALAYAL
MALAYALA
MALAYALAM
*****
*****
*****
*****
*****
12345
2468
369
48
5
1
12
123
1234
12345
123456
12345
1234
123
12
1
A
11
BBB
2222
CCCCC
333333
DDDDDDD
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
*
* *
* *
* *
* *
* *
* *
* *
*
27.Write a program to print the following patten
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
*
* *
* *
* *
* *
***********
*******
******
*****
****
***
**
*
**
***
****
*****
******
*******
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
A
B B
C C C
D D D D
E E E E E
F F F F F F
* *
* *
* *
* *
*
1
2 2
3 3
4 4
5 5
A B C D E
A B C D
A B C
A B
A
* * **
* *
* *
* * * *
*
***
*
***
***
*
***
***
***
*
***
***
***
***
X
XX
XXX
X
XX
XXX
XXXX
X
XX
XXX
XXXX
XXXXX
*****
*****
*****
*****
*****
1
12
123
1234
12345
123456
12345
1234
123
12
1
1
123
12345
1234567
12345
123
1
123456
12345
1234
123
12
12
123
1234
12345
123456
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
*
***
*****
*******
*********
*******
*****
***
*
X
XXX
X
X
XXXXXX
X
X
X
XXXXXXXXX