Question 3:
(2 marks)
The given file Q3.c already contains statements to input data for the integer 1-D array and the integer variable named x. You should write statements to count the even elements greater than x in the array.
Notes:
- You can create new functions if you see it is necessary.
- Do not edit given statements in the main function.
Sample input and output:
Input: n = 5
Array: 1 7 8 4 10
x=4
After processing: count = 2
Output for marking:
OUTPUT:2
Question 4:
(3 marks)
The given file Q4.c already contains statements to input a string named str and a character named ch.You write the statements to count the number of occurrences of the character ch in the string str (notcase-sensitive).
Close
+ 100%
Zoom