Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

WEEK-3

1) AIM: Write a C program to find the Square root of a given Number.

Algorithm:

Step-1: Start
Step-2: Accept one number from user.
Step-3: Use the function sqrt() to find square root.
Step-4: Print the result.
Step-5: End

2)AIM: Write a C program to find the compound interest

Algorithm:

Step-1: Start

Step-2: Declare variables principal, rate, time, Amount, CI

Step-3: Accept input values of principal, rate, time

Step-4: Calculate total Amount using Amount= P(1 + R/100)t

Step-5: Calculate Compound Interest using CI = Amount – P

Step-6: Print CI as output

Step-7: Stop

3) AIM: Write a C program to find the area of triangle using heron’s formulae

Algorithm:

Step-1: Start

Step-2: Declare the variables for sides of triangle as a, b, c, and s as half perimeter, and area

Step-3: accept three sides a, b, c as input from run time

Step-4: Calculate Half – Perimeter s = (a+b+c)/2

Step-5: Calculate area of a triangle using Heron‟s formula area = sqrt(s*(s-a)*(s-b)*(s-c))

Step-6: Print the Heron‟s area of a Triangle “area” as output

Step-7: Stop
4) AIM: Write a C program to Calculate the Distance travelled by an object

Algorithm:

Step-1: Start

Step-2: Declare the Variables v, t, and d for velocity, time, and distance

Step-3: Accept values for v, t as input

Step-4: Calculate the distance using the formula d=v*t (distance = velocity * time)

Step-5: Display the Distance of object travelled „d‟ as output

Step-6: Stop

You might also like