Question 1: Find The Largest Value of Two Numbers
Question 1: Find The Largest Value of Two Numbers
Subject: PRF192
Duration: 80’
Based on C language, you are required to create an application that likes the description below:
1. Question 1 [2]
2. Question 2 [3]
3. Question 3 [ 5]
4. Exit
The user inputs an option (1,2,3, or 4), the coincide question will run.
Question 2: input the list of numbers from the keyboard until input 0.
- display this list.
- get the sum of prime numbers
for example: input 1 2 4 3 5 0
- the list: 1 2 4 3 5
- sum of prime numbers: 5
Question 3: Input the list of numbers that are only 0 or 1. Convert it to the decimal number
For example:
input : 121110 enter, out: invalid
input: 1001 enter => out: 9
input:10000001 enter =>out: 129
The End