ASM1
ASM1
The given file Q1.c already contains statements to input data for 3 sides of a triangle. You should write
statements so that print out the area of that triangle.
Notes:
Heron's formula for three side lengths a, b, c:
Question 2:
(3 marks)
The given file Q2.c already contains statements to input the integer variable named n. You should write
statements to calculate expression value:
1 1 1 1
S=1+ + 2 + 3 + …+ n
3 3 3 3
Notes:
- You can create new function(s) if you see it is necessary.
- Do not edit given statements in the main function.
(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 print out the count of how many times 'x' appears in
the array.
Notes:
- You can create new function(s) if you see it is necessary.
- Do not edit given statements in the main function.
Question 4:
(3 marks)
The given file Q4.c already contains statements to input a string s. You should write statements to
convert the character 'a' in string s to uppercase.
Notes:
- You can create new function(s) if you see it is necessary.
- Do not edit given statements in the main function.