SlideShare a Scribd company logo
1 of 1
Download to read offline
Use C programming
Make sure everything works only upload
Solution
#include
float my_func(float x)
{
return (0.1*x*x*x)+1;
}
float approx_integral(float a, float b, int n)
{
int i;
float s=0,y=0,h;
h=(b-a)/n;
for(i=1;i<=n-1;i++)
{
s=s+my_func(a+i*h);
}
y=(my_func(a)+my_func(b)+2*s)*h/2;
return y;
}
int main()
{
float a,b;
int n;
printf("Integrate over [A,B] over N intervals. Input A, B, N:  ");
scanf("%f %f %d",&a,&b,&n);
if(b

More Related Content

More from FORTUNE2505

In Aristotles Poetics he speaks of epics and tragedies. How do.pdf
In Aristotles Poetics he speaks of epics and tragedies. How do.pdfIn Aristotles Poetics he speaks of epics and tragedies. How do.pdf
In Aristotles Poetics he speaks of epics and tragedies. How do.pdf
FORTUNE2505
 
Name the type of chemical messenger is released from the axon termina.pdf
Name the type of chemical messenger is released from the axon termina.pdfName the type of chemical messenger is released from the axon termina.pdf
Name the type of chemical messenger is released from the axon termina.pdf
FORTUNE2505
 
Marilee Jones, the former dean of admissions of the Massachusetts In.pdf
Marilee Jones, the former dean of admissions of the Massachusetts In.pdfMarilee Jones, the former dean of admissions of the Massachusetts In.pdf
Marilee Jones, the former dean of admissions of the Massachusetts In.pdf
FORTUNE2505
 
Know how the complement of mRNAs in a cell can be assayed (in plants.pdf
Know how the complement of mRNAs in a cell can be assayed (in plants.pdfKnow how the complement of mRNAs in a cell can be assayed (in plants.pdf
Know how the complement of mRNAs in a cell can be assayed (in plants.pdf
FORTUNE2505
 
I need to implement in c++ this non-List member function void print.pdf
I need to implement in c++ this non-List member function void print.pdfI need to implement in c++ this non-List member function void print.pdf
I need to implement in c++ this non-List member function void print.pdf
FORTUNE2505
 
I have another assignment due for an advance java programming class .pdf
I have another assignment due for an advance java programming class .pdfI have another assignment due for an advance java programming class .pdf
I have another assignment due for an advance java programming class .pdf
FORTUNE2505
 
4. Real gross domestic prodact A. measures the value of fimal goods a.pdf
4. Real gross domestic prodact A. measures the value of fimal goods a.pdf4. Real gross domestic prodact A. measures the value of fimal goods a.pdf
4. Real gross domestic prodact A. measures the value of fimal goods a.pdf
FORTUNE2505
 
create your own Security Management Model using the NIST Special Pub.pdf
create your own Security Management Model using the NIST Special Pub.pdfcreate your own Security Management Model using the NIST Special Pub.pdf
create your own Security Management Model using the NIST Special Pub.pdf
FORTUNE2505
 
Consider the following simple macroeconomic model C, 0 + ,K + 2.pdf
Consider the following simple macroeconomic model C, 0 + ,K + 2.pdfConsider the following simple macroeconomic model C, 0 + ,K + 2.pdf
Consider the following simple macroeconomic model C, 0 + ,K + 2.pdf
FORTUNE2505
 
Can you convert this code into a C++ code.pdf
Can you convert this code into a C++ code.pdfCan you convert this code into a C++ code.pdf
Can you convert this code into a C++ code.pdf
FORTUNE2505
 

More from FORTUNE2505 (19)

In Aristotles Poetics he speaks of epics and tragedies. How do.pdf
In Aristotles Poetics he speaks of epics and tragedies. How do.pdfIn Aristotles Poetics he speaks of epics and tragedies. How do.pdf
In Aristotles Poetics he speaks of epics and tragedies. How do.pdf
 
Name the type of chemical messenger is released from the axon termina.pdf
Name the type of chemical messenger is released from the axon termina.pdfName the type of chemical messenger is released from the axon termina.pdf
Name the type of chemical messenger is released from the axon termina.pdf
 
Marilee Jones, the former dean of admissions of the Massachusetts In.pdf
Marilee Jones, the former dean of admissions of the Massachusetts In.pdfMarilee Jones, the former dean of admissions of the Massachusetts In.pdf
Marilee Jones, the former dean of admissions of the Massachusetts In.pdf
 
Know how the complement of mRNAs in a cell can be assayed (in plants.pdf
Know how the complement of mRNAs in a cell can be assayed (in plants.pdfKnow how the complement of mRNAs in a cell can be assayed (in plants.pdf
Know how the complement of mRNAs in a cell can be assayed (in plants.pdf
 
In Module 5 the you are here slide indicates we are currently in.pdf
In Module 5 the you are here slide indicates we are currently in.pdfIn Module 5 the you are here slide indicates we are currently in.pdf
In Module 5 the you are here slide indicates we are currently in.pdf
 
Identify the role you believe mobile devices have on email investiga.pdf
Identify the role you believe mobile devices have on email investiga.pdfIdentify the role you believe mobile devices have on email investiga.pdf
Identify the role you believe mobile devices have on email investiga.pdf
 
I need to implement in c++ this non-List member function void print.pdf
I need to implement in c++ this non-List member function void print.pdfI need to implement in c++ this non-List member function void print.pdf
I need to implement in c++ this non-List member function void print.pdf
 
I have another assignment due for an advance java programming class .pdf
I have another assignment due for an advance java programming class .pdfI have another assignment due for an advance java programming class .pdf
I have another assignment due for an advance java programming class .pdf
 
4. Real gross domestic prodact A. measures the value of fimal goods a.pdf
4. Real gross domestic prodact A. measures the value of fimal goods a.pdf4. Real gross domestic prodact A. measures the value of fimal goods a.pdf
4. Real gross domestic prodact A. measures the value of fimal goods a.pdf
 
Hypothesis What is your hypothesis for the genetic characteristi.pdf
Hypothesis  What is your hypothesis for the genetic characteristi.pdfHypothesis  What is your hypothesis for the genetic characteristi.pdf
Hypothesis What is your hypothesis for the genetic characteristi.pdf
 
How is a process shown in a DFD(data flow diagramSolution Data.pdf
How is a process shown in a DFD(data flow diagramSolution  Data.pdfHow is a process shown in a DFD(data flow diagramSolution  Data.pdf
How is a process shown in a DFD(data flow diagramSolution Data.pdf
 
Hey,Why is it not possible in Java to write a swap routine that sw.pdf
Hey,Why is it not possible in Java to write a swap routine that sw.pdfHey,Why is it not possible in Java to write a swap routine that sw.pdf
Hey,Why is it not possible in Java to write a swap routine that sw.pdf
 
5. As know, a virulent strain ofstaphylococcus aureus has arisen that.pdf
5. As know, a virulent strain ofstaphylococcus aureus has arisen that.pdf5. As know, a virulent strain ofstaphylococcus aureus has arisen that.pdf
5. As know, a virulent strain ofstaphylococcus aureus has arisen that.pdf
 
Description of the labCinnamaldehyde was separated from a solutio.pdf
Description of the labCinnamaldehyde was separated from a solutio.pdfDescription of the labCinnamaldehyde was separated from a solutio.pdf
Description of the labCinnamaldehyde was separated from a solutio.pdf
 
Describe benefits and shortcomings of transmission control protocol .pdf
Describe benefits and shortcomings of transmission control protocol .pdfDescribe benefits and shortcomings of transmission control protocol .pdf
Describe benefits and shortcomings of transmission control protocol .pdf
 
create your own Security Management Model using the NIST Special Pub.pdf
create your own Security Management Model using the NIST Special Pub.pdfcreate your own Security Management Model using the NIST Special Pub.pdf
create your own Security Management Model using the NIST Special Pub.pdf
 
Consider the following simple macroeconomic model C, 0 + ,K + 2.pdf
Consider the following simple macroeconomic model C, 0 + ,K + 2.pdfConsider the following simple macroeconomic model C, 0 + ,K + 2.pdf
Consider the following simple macroeconomic model C, 0 + ,K + 2.pdf
 
12. Explain why concentrated benefits and widely disbursed costs are.pdf
12. Explain why concentrated benefits and widely disbursed costs are.pdf12. Explain why concentrated benefits and widely disbursed costs are.pdf
12. Explain why concentrated benefits and widely disbursed costs are.pdf
 
Can you convert this code into a C++ code.pdf
Can you convert this code into a C++ code.pdfCan you convert this code into a C++ code.pdf
Can you convert this code into a C++ code.pdf
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

Use C programmingMake sure everything works only upload.pdf

  • 1. Use C programming Make sure everything works only upload Solution #include float my_func(float x) { return (0.1*x*x*x)+1; } float approx_integral(float a, float b, int n) { int i; float s=0,y=0,h; h=(b-a)/n; for(i=1;i<=n-1;i++) { s=s+my_func(a+i*h); } y=(my_func(a)+my_func(b)+2*s)*h/2; return y; } int main() { float a,b; int n; printf("Integrate over [A,B] over N intervals. Input A, B, N: "); scanf("%f %f %d",&a,&b,&n); if(b