marks)
✓ Kizspy.me
The given file Q1.c already contains statements to enter three positive integers,
a, b, and c, which are the lengths of the three sides of a triangle ABC. You should
write statements to calculate the length of the median ma (if a, b, and c are not
3 sides of the triangle then return 0)
Hints:
"
a, b, and c are the lengths of the three sides of the triangle if each value is less than
the sum of the others (a <b+c, b<a+c, c<a+b)
m2 (2*(b+c)-a²)/4
You can create new functions if you see it as necessary
Do not edit given statements in the main function
The output value is formatted in two decimal places
Sample input and output:
-Input: 123
Output for marking:
OUTPUT:
0.00
-Input: 456
Output for marking:
OUTPUT:
5.15
Question 2:
(3 marks)
The given file Q2.c already contains statements to input an integer variable named n (n>0). You
should write statements to calculate the following expression value:
Notes:
Zoom
+ 100%
S(n) (1+1/12)*(1+1/2)** (1+1/n²)
Close