As I'm just a beginner of C program, please help ^^.
I use the following program to estimate the area of
sqr= square root,
p2 = power 2,
from x=0 to x=2.
I use a rectangle to enclose the graph with height 1.5 and width 2.0.
y<= 2 power 0.5 = 1.414 as cos(x)<=1
so i use this estimation formula:
if y<1.414, then the pts lie in the graph.
if y>1.414, then the pts lie outside the graph.
for x between 0 and 2.0 with increment 0.00001.
and my program is the following.
# include <stdio.h>
# include <math.h>
for (x=0; x<2; x=x+0.00001)
printf("red area = %f \n", rect*red/total);
please help me, thanks.