Mock Interview Questions
Mock Interview Questions
2. Write a C program to count even and odd numbers in an array and also print the sum of the even numbers
in an array.
3. Write a C program to sort an array and print the count of ‘1’ in the array.
4. Write a program to delete two elements after the occurrence of an even number.
5. Write a program to find array elements that repeat 2 times.
6. Write a program to find two array elements whose sum is closest to zero.
7. In an array replace all the multiples of three by ‘0’ and multiples of five by ‘1’.
8. Write a program in C to read n number of values in an array and display the array after skipping two values
next to the multiples of 5.
9. Write a program in C to get an array from users and remove odd numbers from the array and find the sum
of the existing values in the array
10. Write a program in C to get an array from users and remove even numbers from the array and find the sum
of the existing values in the array
11. Find the sum of unique prime numbers in an array.
12. In an array remove all the prime numbers > 50 and remove all the non-prime numbers < 50.
13. In an array replace all the multiples of three by ‘1’ and multiples of five by ‘0’
14. Write a program to delete two elements after the occurrence of a prime number and replace all even
numbers by 0.
15. Write a C program to sort an array and print the count of ‘1’ in the array.
16. In an array, replace all the prime numbers with ‘ * ‘ & remove all the odd numbers.
17. Sort the array and replace elements in an odd position with * and remove prime numbers
18. Write a C program to sort an array and print the count of unique elements in the array.
19. Write a C program to print the sum of unique elements from an array
20. Write a program to delete all the multiples of 5 in an array.
21. Write a program to print array elements in reverse order?
22. Write a program to find the missing number in a given integer array of 1 to 100?
23. Write a program to find the largest and smallest number in an unsorted integer array?
24. Write a program to insert an element into an array at a specified position ?.
25. Write a program to find the duplicate number on a given integer array
26. Write a program to reverse the array
27. Write a program to find the factorial of a number
28. Write program to to copy the elements of one array into another array
29. Write a program to print all unique elements in an array
30. Write a program to insert an elements in specified position in an array
31. Write a program to sort elements of an array in ascending order
32. Write a program to find the average of n numbers using arrays
33. Write a program to delete a integer from an array
34. Write a program to print the number of odd & even numbers in an array
35. Write a program to find the 2nd largest 2nd smallest and smallest elements in an array
36. Write a program to merge and sort elements of two different arrays
37. Write a program to print all unique elements in an array
38. Write a program to remove all the prime numbers in an array
39. Write a program to find the sum of all the even numbers in an array
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
* *
* *
* *
**
*
**
* *
* *
* *
3.Print
the array elements in the following 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
*
* *
* *
* *
* *
* *
* *
* *
*
16.Write a program in C 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
* *
* *
* *
* *
*
24.Write a program in C to print the following pattern
1
2 2
3 3
4 4
5 5
A B C D E
A B C D
A B C
A B
A
* * **
* *
* *
* * * *
*******
** **
* * * *
* * *
* * * *
* * **
*******
***
*
*
*
******
******
*
*
*
*********
*********
*********
30.Write a program in C to print the following star pattern.
******
*
******
*
*
******
*
*
*
******
*
*
*
*
******
*
***
*
***
***
*
***
***
***
*
***
***
***
***
X
XX
XXX
X
XX
XXX
XXXX
X
XX
XXX
XXXX
XXXXX
XXXX
XXX
X
X
X
XXX
XX
X
X
X
XX
X
*****
*
*
***
*
*
*****
*
*
***
*
*
*****
*****
*****
*****
*****
*****
1
12
123
1234
12345
123456
12345
1234
123
12
1
1
123
12345
1234567
12345
123
1
123456
12345
1234
123
12
1
12
123
1234
12345
123456
111111
111122
111333
114444
155555
666666
41.Write a program in C to print the following pattern.
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
*
$*
* $*
$*$*
*$*$*
44. Write a program in C to print the following star pattern.
*
***
*****
*******
*********
*******
*****
***
*
45.Print the following pattern
X
XXX
X
X
XXXXXX
X
X
X
XXXXXXXXX
49.