Title | Tutorial 8 SP - 1. Write a C++ program to evaluate ∫ using Trapezoidal rule up to three significant |
---|---|
Course | Structured Programming |
Institution | Universiti Malaya |
Pages | 23 |
File Size | 322.7 KB |
File Type | |
Total Downloads | 6 |
Total Views | 135 |
1. Write a C++ program to evaluate ∫ using Trapezoidal rule up to three significant figures.
2. Write a C++ function program to evaluate ∫ using Trapezoidal rule correct to four decimal places. Compare the result with the exact solution 1.48766.
3. Write a C++ program to evaluate ∫√ usin...
TUTORIAL 8 QUESTION 1 Write a C++ program to evaluate∫ to three significant figures. #include #include #include using namespace std;
float f(float x) { float func; func = exp(x); return func; } void main() { float a,b,h,sum=0, Trap; int i, n; cout a; cout > b; cout > n; h=(b-a)/n;
using Trapezoidal rule up
TUTORIAL 8 for(i=1;i...