You are on page 1of 1

COM 127 - C LANGUAGE ASSIGNMENT

NOTE:
1. SUBMISSION DATE: Thursday 18/01/2024
2. SUBMIT CODE PRINTED IN A COMPILED ENVIRONMENT & THE OUTPUT ATTACHED.

1. Write a C program that accepts the three sides (a,b,c) of a triangle. Then compute the Area and the
Perimeter of the triangle using the formula:

Area = , where s = , and Perimeter = a + b + c

2. Consider the formula where s = Average Speed, d = Total distance travelled, and t = Total time
taken to cover the distance. Write a C program that receives from a user total distance covered and time taken
to cover the distance, then compute the average speed.

3. Write a C language program that generates odd numbers from 250 to 350 using the for statement. Test to
determine, then print (list) each odd number divisible by 5.

4. Write a C language program to compute the Volume and the Area of a sphere using the formulae: Volume

= and Area = 4 r2 . Let

5. Write a C language program that accepts the length and the breadth of a rectangle from the user. Then
compute the Area and the Perimeter of the rectangle.

6. Write a c program that reads 20 float values from the keyboard into an array named scores. Print out these
values in reverse order and compute the sum and the average of the numbers.

7 Write a C program to determine how much money will accumulate in a bank account after n years if a
known amount, p, is deposited initially and the account collects interest at a rate, r percent per year,
compounded annually. Use the formula, F= P(1+r/100)n, where F represents the future accumulation of money

You might also like