# help me!

Page 1 of 1

## 3 Replies - 816 Views - Last Post: 27 March 2008 - 02:05 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=47195&amp;s=8fdebac8f2763b28e6b200e113c4e810&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 jajaluv2eat

• New D.I.C Head

Reputation: 0
• Posts: 1
• Joined: 24-March 08

# help me!

Posted 24 March 2008 - 09:16 PM

The surface of a certain materials is given by A= ∫(p to q) y dx where y is given as (9 - x2) e(-x/3) and the limits of x is from -3 to +3.

Write a program to numerically integrate A to find out how many square centimeters is the surface area for the given limits. Also display the exact results computed using the indefinite integral e(-x/3) (3x2 + 18x + 27). Using trapezoidal rule.

urgent!!

This post has been edited by jajaluv2eat: 24 March 2008 - 09:18 PM

Is This A Good Question/Topic? 0

## Replies To: help me!

### #2 no2pencil

• Professor Snuggly Pants

Reputation: 5912
• Posts: 28,935
• Joined: 10-May 07

## Re: help me!

Posted 24 March 2008 - 09:26 PM

jajaluv2eat, on 24 Mar, 2008 - 09:16 PM, said:

urgent!!

Wow, urgent.

You might get a better response if you post your question in the C/C++ forum.

Also, you'll want to include any relevant source code for your project, as well as any errors, so we can better assist you with your question.

Welcome to Dream In Code!
Was This Post Helpful? 0

### #3 jajaluv2eat

• New D.I.C Head

Reputation: 0
• Posts: 1
• Joined: 24-March 08

## Re: help me!

Posted 26 March 2008 - 08:38 PM

jajaluv2eat, on 24 Mar, 2008 - 09:16 PM, said:

The surface of a certain materials is given by A= ∫(p to q) y dx where y is given as (9 - x2) e(-x/3) and the limits of x is from -3 to +3.

Write a program to numerically integrate A to find out how many square centimeters is the surface area for the given limits. Also display the exact results computed using the indefinite integral e(-x/3) (3x2 + 18x + 27). Using trapezoidal rule.

urgent!!

#include<stdio.h>
float fn(float k);
main()
{
int i,n;
float a=-3,b=3,h,x,y,area;
printf("enter the number of Trapezoidal: ");
scanf("%d",&n);
h = (b-a)/n;
y=0.0;
for (i=1; i<n; i++)
{
x = a + i*h;
y = y + fn(x);
}
area = h*(y + (fn(a) + fn()/2);
printf("\n\nThe area under the curve is %.4f\n\n",area);
system ("pause");
}
float fn(float k)
{
float yy;
yy = (9-k*k)*exp(-k/3);
return yy;
}

-program code must contains function, loop,array/file processing
my program dont have array/file processing..can u guys plz modify my program...thnx 4 your help...
Was This Post Helpful? 0

### #4 martin_bg

• New D.I.C Head

Reputation: 0
• Posts: 23
• Joined: 20-March 08

## Re: help me!

Posted 27 March 2008 - 02:05 AM

Check this out. I think it's going to be useful:

http://www.nrbook.com/a/bookcpdf.php (chapter 4)
Was This Post Helpful? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }