PRF192_-_FA_2023_-_PE_-_s_7_1260.webp
Sasuke_sama

PRF192_-_FA_2023_-_PE_-_s_7_1260.webp

Question 2:
(1 mark, file to be edited: Q2.c)
The program allows the user to input an array of integers consisting of 'n' elements from the keyboard.Print to the screen the average of the values of the odd numbers, with three decimal places.
Here is an example of how the program will run:
Enter: n = 6, elements: 9, 7, 12, 8, 6, 15
6
9 7 12 8 6 15
OUTPUT:
10.333
Press any key to continue
Question 3:
(1 mark, file to be edited: Q3.c)
The program allows the user to enter an array of integers consisting of 'n' elements from the keyboard.
Find and print to the screen the elements that are prime numbers. If not found, print: "No prime number exists".
Here is an example of how the program will run:
n = 6; array = [1, -2, 3, 9, 6, 7]
n = 5; array = [4, 8, -3, 6, 10]
Zoom
+ 93%
Close

Chưa có bình luận nào.

Thông tin

Category
PRF192
Thêm bởi
Sasuke_sama
Ngày thêm
Lượt xem
4,404
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRF192_-_FA_2023_-_PE_-_s_7_1260.webp
File size
46.8 KB
Dimensions
1552px x 660px

Share this media

Back
Bên trên Bottom