Question 4:
(1 mark, file to be edited: Q4.c)
The program allows the user to enter a positive integer 'n' from the keyboard, 'n' being the number of rows of a right triangle.s
Print out the pattern of a right triangle of prime numbers.
Below is an example of how the program will run.
Enter n = 6
6
OUTPUT:
2
35
7 11 13
17 19 23 29
31 37 41 43 47
53 59 61 67 71 73
Press any key to continue
Question 5:
(1 mark, file to be edited: Q5.c)
The program allows the user to input an integer array of 'n' elements. With 'n' and the value of the elements entered from the keyboard.
The program prints to the screen that the elements are sorted in descending order of odd numbers first
+ 100%
Zoom
Close