Zoom
-Input: n = 5
Output for marking:
OUTPUT:0
-Input: n = 6
Output for marking:
OUTPUT:1
Question 2:
(3 marks)
The given file Q2.c already contains statements to input an integer variable named n. You should write statements to sum the primes less than n (the primes start from 2)
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 = 10
After processing: result = 2+ 3+5 + 7 = 17
Output for marking:
OUTPUT:17
Question 3:
(2 marks)
+ 100%
Close