Starting from:
$30

$24

Computer Programming Lab #1 Solved

Use the template .c file and write a program that performs following tasks respectively. These two tasks should be distinct functions and called from main() function. Once they been called, each will call another function to make the calculation for the related task. Do not use any library except stdio.h. Stick to the template file, do not write extra functions.


    1. The program takes the side lengths of a right triangle as input and calculate the 3 trigonometric functions below for an angle. Note that the inputs should be integers.
sin x =

cosx =

tan x =
















Example:


    a: 3

    b: 4

    c: 5

sinx = 0.6

cosx = 0.8

tanx = 0.75



    2. The program asks user to enter their age and then print it in seconds. Make sure that your program is able to make a calculation for an input of 0-100 age.

Example:


Your age: 25

You    are    788400000    seconds

More products