All pastes #977627 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-08 23:22 UTC
rendered paste body
#include <stdio.h>
#include <math.h>

#define PI 3.14159

void main ()
{
	int N; 
	double h, i, solution, a, b, fx;
	a=PI/4;
	b=PI/2;

	printf("How many intervals would you like to use to estimate the solution?");
	scanf("%i", &N);

	h=((b-a)/N);

	for(i=a; i<=b; i++)
	{
		fx=(h*((0.5*i)/sin(i)));
		fx += fx;
	}

	printf("\n");
	printf("The approximate estimate is: f(x)=%2.8f/\n", fx);
	printf("\n");

	return;