際際滷

際際滷Share a Scribd company logo
LAB ASSIGNMENT 4
Submitted By
MOURIN MONDOL
ID-152-35-1298
Numerical Analysis Lab
13/04/2018
#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
double X,Y,SX=0,SY=0,SXY=0,SXX=0;
for(int i=0;i<n;i++){
scanf("%lf%lf",&X,&Y);
SX+=X,SY+=Y,SXY+=(X*Y),SXX+=(X*X);
}
double XBAR=SX/n,YBAR=SY/n;
double a1=(((n*SXY)-(SX*SY))/((n*SXX)-(SX*SX)));
printf("a1=%lfn",a1);
double a0=YBAR-(a1*XBAR);
printf("a0=%lfn",a0);
printf("Y=%lf+%lfXn",a0,a1);
return 0;
}
OUTPUT
Ad

Recommended

COMPUTER GRAPHICS
COMPUTER GRAPHICS
Milind Prajapat
Statements in C
Statements in C
Prabhu Govind
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language
9096308941
C programming BY Mazedur
C programming BY Mazedur
Mazedurr rahman
C programs pbq final
C programs pbq final
Azad public school
week-2x
week-2x
KITE www.kitecolleges.com
Programa2
Programa2
fabiorodriguez123
Array menu
Array menu
Sayantan Sur
Fred
Fred
09461193
A Beginner's Guide to MS Excel
A Beginner's Guide to MS Excel
Anshul Punetha
C programming codes for the class assignment
C programming codes for the class assignment
Zenith SVG
Programa
Programa
henriquez1986
Eso3 tablasestadisticas blog
Eso3 tablasestadisticas blog
Marta Mart鱈n
week-23x
week-23x
KITE www.kitecolleges.com
PHP, Arrays & Functional Programming
PHP, Arrays & Functional Programming
Michael Rutz
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmos
DNAD
Factorial
Factorial
Ankit Dubey
Program in C language to implement linear search using pointers
Program in C language to implement linear search using pointers
Dr. Loganathan R
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
Parallel Plates
Parallel Plates
carloszpereyra
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
Dr. Loganathan R
XKE Typeclass
XKE Typeclass
Mathieu DULAC
10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n
Charmille Jamaine Gabao
week-8x
week-8x
KITE www.kitecolleges.com
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
Dr. Loganathan R
Rombo matriz
Rombo matriz
epetekaun
Positive (2)
Positive (2)
Ankit Dubey
Test2
Test2
Komal Pardeshi
Chat Application | RSD
Chat Application | RSD
Rajon
AND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtional
Rajon

More Related Content

What's hot (20)

Fred
Fred
09461193
A Beginner's Guide to MS Excel
A Beginner's Guide to MS Excel
Anshul Punetha
C programming codes for the class assignment
C programming codes for the class assignment
Zenith SVG
Programa
Programa
henriquez1986
Eso3 tablasestadisticas blog
Eso3 tablasestadisticas blog
Marta Mart鱈n
week-23x
week-23x
KITE www.kitecolleges.com
PHP, Arrays & Functional Programming
PHP, Arrays & Functional Programming
Michael Rutz
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmos
DNAD
Factorial
Factorial
Ankit Dubey
Program in C language to implement linear search using pointers
Program in C language to implement linear search using pointers
Dr. Loganathan R
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
Parallel Plates
Parallel Plates
carloszpereyra
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
Dr. Loganathan R
XKE Typeclass
XKE Typeclass
Mathieu DULAC
10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n
Charmille Jamaine Gabao
week-8x
week-8x
KITE www.kitecolleges.com
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
Dr. Loganathan R
Rombo matriz
Rombo matriz
epetekaun
Positive (2)
Positive (2)
Ankit Dubey
Test2
Test2
Komal Pardeshi
A Beginner's Guide to MS Excel
A Beginner's Guide to MS Excel
Anshul Punetha
C programming codes for the class assignment
C programming codes for the class assignment
Zenith SVG
Eso3 tablasestadisticas blog
Eso3 tablasestadisticas blog
Marta Mart鱈n
PHP, Arrays & Functional Programming
PHP, Arrays & Functional Programming
Michael Rutz
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmos
DNAD
Program in C language to implement linear search using pointers
Program in C language to implement linear search using pointers
Dr. Loganathan R
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
Dr. Loganathan R
10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n
Charmille Jamaine Gabao
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
Dr. Loganathan R
Rombo matriz
Rombo matriz
epetekaun

More from Rajon (16)

Chat Application | RSD
Chat Application | RSD
Rajon
AND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtional
Rajon
Modern Elicitation Process
Modern Elicitation Process
Rajon
Pillar's of Pixel's | Project report
Pillar's of Pixel's | Project report
Rajon
Farm Manager | Project Proposal
Farm Manager | Project Proposal
Rajon
Pillar's of Pixel' | Project proposal
Pillar's of Pixel' | Project proposal
Rajon
Displacement addressing
Displacement addressing
Rajon
System Design Flow
System Design Flow
Rajon
Backup Photos- Project Proposal
Backup Photos- Project Proposal
Rajon
Chat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & Design
Rajon
Regular expression
Regular expression
Rajon
Canvas
Canvas
Rajon
Chat Application FAQ
Chat Application FAQ
Rajon
Presentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life Cycle
Rajon
Chat Application [Full Documentation]
Chat Application [Full Documentation]
Rajon
Presentation On Online Airline Ticket Booking Project Planning
Presentation On Online Airline Ticket Booking Project Planning
Rajon
Chat Application | RSD
Chat Application | RSD
Rajon
AND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtional
Rajon
Modern Elicitation Process
Modern Elicitation Process
Rajon
Pillar's of Pixel's | Project report
Pillar's of Pixel's | Project report
Rajon
Farm Manager | Project Proposal
Farm Manager | Project Proposal
Rajon
Pillar's of Pixel' | Project proposal
Pillar's of Pixel' | Project proposal
Rajon
Displacement addressing
Displacement addressing
Rajon
System Design Flow
System Design Flow
Rajon
Backup Photos- Project Proposal
Backup Photos- Project Proposal
Rajon
Chat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & Design
Rajon
Regular expression
Regular expression
Rajon
Canvas
Canvas
Rajon
Chat Application FAQ
Chat Application FAQ
Rajon
Presentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life Cycle
Rajon
Chat Application [Full Documentation]
Chat Application [Full Documentation]
Rajon
Presentation On Online Airline Ticket Booking Project Planning
Presentation On Online Airline Ticket Booking Project Planning
Rajon
Ad

Recently uploaded (20)

Industrial internet of things IOT Week-3.pptx
Industrial internet of things IOT Week-3.pptx
KNaveenKumarECE
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
60 Years and Beyond eBook 1234567891.pdf
60 Years and Beyond eBook 1234567891.pdf
waseemalazzeh
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Mark Billinghurst
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
惠惘惘 惺 悋惠忰 悋惆悋 惠惆 悋悋悄 忰 悴悋忰.pdf
惠惘惘 惺 悋惠忰 悋惆悋 惠惆 悋悋悄 忰 悴悋忰.pdf
忰惆 惶惶 惠惠悸
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
resming1
Machine Learning - Classification Algorithms
Machine Learning - Classification Algorithms
resming1
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego L坦pez-de-Ipi単a Gonz叩lez-de-Artaza
Data Structures Module 3 Binary Trees Binary Search Trees Tree Traversals AVL...
Data Structures Module 3 Binary Trees Binary Search Trees Tree Traversals AVL...
resming1
Proposal for folders structure division in projects.pdf
Proposal for folders structure division in projects.pdf
Mohamed Ahmed
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
resming1
How to Un-Obsolete Your Legacy Keypad Design
How to Un-Obsolete Your Legacy Keypad Design
Epec Engineered Technologies
Introduction to sensing and Week-1.pptx
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
System design handwritten notes guidance
System design handwritten notes guidance
Shabista Imam
AI_Presentation (1). Artificial intelligence
AI_Presentation (1). Artificial intelligence
RoselynKaur8thD34
Deep Learning for Natural Language Processing_FDP on 16 June 2025 MITS.pptx
Deep Learning for Natural Language Processing_FDP on 16 June 2025 MITS.pptx
resming1
Industrial internet of things IOT Week-3.pptx
Industrial internet of things IOT Week-3.pptx
KNaveenKumarECE
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
60 Years and Beyond eBook 1234567891.pdf
60 Years and Beyond eBook 1234567891.pdf
waseemalazzeh
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Mark Billinghurst
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
惠惘惘 惺 悋惠忰 悋惆悋 惠惆 悋悋悄 忰 悴悋忰.pdf
惠惘惘 惺 悋惠忰 悋惆悋 惠惆 悋悋悄 忰 悴悋忰.pdf
忰惆 惶惶 惠惠悸
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
resming1
Machine Learning - Classification Algorithms
Machine Learning - Classification Algorithms
resming1
Data Structures Module 3 Binary Trees Binary Search Trees Tree Traversals AVL...
Data Structures Module 3 Binary Trees Binary Search Trees Tree Traversals AVL...
resming1
Proposal for folders structure division in projects.pdf
Proposal for folders structure division in projects.pdf
Mohamed Ahmed
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
resming1
Introduction to sensing and Week-1.pptx
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
System design handwritten notes guidance
System design handwritten notes guidance
Shabista Imam
AI_Presentation (1). Artificial intelligence
AI_Presentation (1). Artificial intelligence
RoselynKaur8thD34
Deep Learning for Natural Language Processing_FDP on 16 June 2025 MITS.pptx
Deep Learning for Natural Language Processing_FDP on 16 June 2025 MITS.pptx
resming1
Ad

Numerical Analysis lab 4

  • 1. LAB ASSIGNMENT 4 Submitted By MOURIN MONDOL ID-152-35-1298 Numerical Analysis Lab 13/04/2018
  • 2. #include <stdio.h> int main(){ int n; scanf("%d",&n); double X,Y,SX=0,SY=0,SXY=0,SXX=0; for(int i=0;i<n;i++){ scanf("%lf%lf",&X,&Y); SX+=X,SY+=Y,SXY+=(X*Y),SXX+=(X*X); } double XBAR=SX/n,YBAR=SY/n; double a1=(((n*SXY)-(SX*SY))/((n*SXX)-(SX*SX))); printf("a1=%lfn",a1); double a0=YBAR-(a1*XBAR); printf("a0=%lfn",a0); printf("Y=%lf+%lfXn",a0,a1); return 0; } OUTPUT