1) area of the circle given the diameter.
2)area of the circle given the circumference.
3)area of the circle given center point (x1,y1) and one point on the perimeter (x2,y2).
(Hint: input the two points and compute the distance between them as radius)
4)area of a triangle given three sides a,b,c.( assume they form a triangle)
5)area and perimeter of a right angled triangle given width(w) and height(h).
6)volume and surface area of a sphere given the radius.
7)area of an equilateral triangle given one side (s).
8) volume and surface area of the cylinder given radius(r) and height(h).
9) volume and surface area of a cube given one side ( s).
10)hypotenuse of a right-angled triangle, given the length of the other two sides.
Note: assume uniform input values( eg: cm)
11) Find A, the Final Investment Value, using the simple interest formula:
2)area of the circle given the circumference.
3)area of the circle given center point (x1,y1) and one point on the perimeter (x2,y2).
(Hint: input the two points and compute the distance between them as radius)
4)area of a triangle given three sides a,b,c.( assume they form a triangle)
5)area and perimeter of a right angled triangle given width(w) and height(h).
6)volume and surface area of a sphere given the radius.
7)area of an equilateral triangle given one side (s).
8) volume and surface area of the cylinder given radius(r) and height(h).
9) volume and surface area of a cube given one side ( s).
10)hypotenuse of a right-angled triangle, given the length of the other two sides.
Note: assume uniform input values( eg: cm)
11) Find A, the Final Investment Value, using the simple interest formula:
A = P(1 + rt) where P is the Principal amount of money to be invested at an Interest Rate R% per period for t Number of Time Periods. Where r is in decimal form; r=R/100;
12)Compute the compound interest(CI)
CI=A-P
CI=A-P
Where, A = future amount
A=P(1+r/n)^(nt)
P = principal
r = rate of interest
n = number of times interest is compounded per year
t = time (in years)
P = principal
r = rate of interest
n = number of times interest is compounded per year
t = time (in years)
Example- You can run this program using gcc in ubuntu
Area of the circle given the diameter
#include <stdio.h>
#include <math.h>
int main()
{
float d,r,area;
system("clear");
printf("Enter the diameter\n");
scanf("%f",&d);
r=d/2;
area=M_PI*r*r;
printf("area of circle=%f\n",area);
}
area of the circle given center point (x1,y1) and one point on the perimeter (x2,y2).
#include <stdio.h>
#include <math.h>
int main()
{
float x1,y1,x2,y2;
float r,a;
system("clear");
printf("Enter the center point (x1,y1)\n");
scanf("%f%f",&x1,&y1);
printf("Enter the point on the circle (x2,y2)\n");
scanf("%f%f",&x2,&y2);
r=sqrt(pow(x2-x1,2)+pow(y2-y1,2)); // finding radius
a=M_PI*r*r; //computing area
printf("area of circle=%.4f\n",a);
}
Note: use -lm option with gcc to link the math module while compiling your program.
Comments
Post a Comment