Earn by twitter on twivert

Sign up for PayPal and start accepting credit card payments instantly.

Tuesday, March 20, 2012

WAP of Simpson's 1/3

/* WAP of Simpson's 1/3 */
#include<stdio.h>
#include<conio.h>
void main()
{
 float x[100],y[100],odd, even,fx,h;
 int size,i;
 clrscr();
 printf("How many value you want to enter: ");
 scanf("%d",&size);

 for(i=0; i<size; i++)
 {
  printf("Enter elements of x[%d]:\n",i);
  scanf("%f",&x[i]);
  printf("Enter elements of y[%d]:\n",i);
  scanf("%f",&y[i]);
 }
 h = x[2]-x[1];
 printf("\nh = %f",h);
 for(i=1; i<size-1; i++)
 {
  if(i%2==0)
  {
   even += 2*y[i];
  }
  else //if(i%2 != 0)
  {
   odd += 4*y[i];
  }
 }

 fx = ( h/3) * ( y[0] + y[size-1] + odd + even );
 printf("\nf(x)= %f",fx);
 getch();
}

ADS

How to earn online

How to earn online:
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786

AddMe

Bookmark and Share