SlideShare a Scribd company logo
1 of 2
Download to read offline
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

More Related Content

What's hot

A Beginner's Guide to MS Excel
A Beginner's Guide to MS ExcelA Beginner's Guide to MS Excel
A Beginner's Guide to MS ExcelAnshul Punetha
 
C programming codes for the class assignment
C programming codes for the class assignmentC programming codes for the class assignment
C programming codes for the class assignmentZenith SVG
 
Eso3 tablasestadisticas blog
Eso3 tablasestadisticas blogEso3 tablasestadisticas blog
Eso3 tablasestadisticas blogMarta Martín
 
PHP, Arrays & Functional Programming
PHP, Arrays & Functional ProgrammingPHP, Arrays & Functional Programming
PHP, Arrays & Functional ProgrammingMichael Rutz
 
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmosLT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmosDNAD
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersDr. Loganathan R
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Dr. Loganathan R
 
Rombo matriz
Rombo matrizRombo matriz
Rombo matrizepetekaun
 

What's hot (20)

Fred
FredFred
Fred
 
A Beginner's Guide to MS Excel
A Beginner's Guide to MS ExcelA Beginner's Guide to MS Excel
A Beginner's Guide to MS Excel
 
C programming codes for the class assignment
C programming codes for the class assignmentC programming codes for the class assignment
C programming codes for the class assignment
 
Programa
ProgramaPrograma
Programa
 
Eso3 tablasestadisticas blog
Eso3 tablasestadisticas blogEso3 tablasestadisticas blog
Eso3 tablasestadisticas blog
 
week-23x
week-23xweek-23x
week-23x
 
PHP, Arrays & Functional Programming
PHP, Arrays & Functional ProgrammingPHP, Arrays & Functional Programming
PHP, Arrays & Functional Programming
 
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmosLT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmos
 
Factorial
FactorialFactorial
Factorial
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
Parallel Plates
Parallel PlatesParallel Plates
Parallel Plates
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
XKE Typeclass
XKE TypeclassXKE Typeclass
XKE Typeclass
 
10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n10740737 1599055096995598 1135912358_n
10740737 1599055096995598 1135912358_n
 
week-8x
week-8xweek-8x
week-8x
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
 
Rombo matriz
Rombo matrizRombo matriz
Rombo matriz
 
Positive (2)
Positive (2)Positive (2)
Positive (2)
 
Test2
Test2Test2
Test2
 

More from Rajon

Chat Application | RSD
Chat Application | RSDChat Application | RSD
Chat Application | RSDRajon
 
AND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtionalAND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtionalRajon
 
Modern Elicitation Process
Modern Elicitation ProcessModern Elicitation Process
Modern Elicitation ProcessRajon
 
Pillar's of Pixel's | Project report
Pillar's of Pixel's | Project reportPillar's of Pixel's | Project report
Pillar's of Pixel's | Project reportRajon
 
Farm Manager | Project Proposal
Farm Manager | Project ProposalFarm Manager | Project Proposal
Farm Manager | Project ProposalRajon
 
Pillar's of Pixel' | Project proposal
Pillar's of Pixel' | Project proposalPillar's of Pixel' | Project proposal
Pillar's of Pixel' | Project proposalRajon
 
Displacement addressing
Displacement addressingDisplacement addressing
Displacement addressingRajon
 
System Design Flow
System Design FlowSystem Design Flow
System Design FlowRajon
 
Backup Photos- Project Proposal
Backup Photos- Project ProposalBackup Photos- Project Proposal
Backup Photos- Project ProposalRajon
 
Chat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & DesignChat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & DesignRajon
 
Regular expression
Regular expressionRegular expression
Regular expressionRajon
 
Canvas
CanvasCanvas
CanvasRajon
 
Chat Application FAQ
Chat Application FAQChat Application FAQ
Chat Application FAQRajon
 
Presentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life CyclePresentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life CycleRajon
 
Chat Application [Full Documentation]
Chat Application [Full Documentation]Chat Application [Full Documentation]
Chat Application [Full Documentation]Rajon
 
Presentation On Online Airline Ticket Booking Project Planning
Presentation On Online Airline Ticket Booking Project PlanningPresentation On Online Airline Ticket Booking Project Planning
Presentation On Online Airline Ticket Booking Project PlanningRajon
 

More from Rajon (16)

Chat Application | RSD
Chat Application | RSDChat Application | RSD
Chat Application | RSD
 
AND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtionalAND | OR |XOR | Conditional | Bi-condtional
AND | OR |XOR | Conditional | Bi-condtional
 
Modern Elicitation Process
Modern Elicitation ProcessModern Elicitation Process
Modern Elicitation Process
 
Pillar's of Pixel's | Project report
Pillar's of Pixel's | Project reportPillar's of Pixel's | Project report
Pillar's of Pixel's | Project report
 
Farm Manager | Project Proposal
Farm Manager | Project ProposalFarm Manager | Project Proposal
Farm Manager | Project Proposal
 
Pillar's of Pixel' | Project proposal
Pillar's of Pixel' | Project proposalPillar's of Pixel' | Project proposal
Pillar's of Pixel' | Project proposal
 
Displacement addressing
Displacement addressingDisplacement addressing
Displacement addressing
 
System Design Flow
System Design FlowSystem Design Flow
System Design Flow
 
Backup Photos- Project Proposal
Backup Photos- Project ProposalBackup Photos- Project Proposal
Backup Photos- Project Proposal
 
Chat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & DesignChat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & Design
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Canvas
CanvasCanvas
Canvas
 
Chat Application FAQ
Chat Application FAQChat Application FAQ
Chat Application FAQ
 
Presentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life CyclePresentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life Cycle
 
Chat Application [Full Documentation]
Chat Application [Full Documentation]Chat Application [Full Documentation]
Chat Application [Full Documentation]
 
Presentation On Online Airline Ticket Booking Project Planning
Presentation On Online Airline Ticket Booking Project PlanningPresentation On Online Airline Ticket Booking Project Planning
Presentation On Online Airline Ticket Booking Project Planning
 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 

Recently uploaded (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 

Numerical Analysis Lab Assignment 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