SlideShare a Scribd company logo
1 of 2
I knew how to type the formula but had troubles on looping it. Cau you show me how to do this
problem?
The image of this problem can be found at:
https://drive.google.com/open?id=0B7WUYmW3LyL6RnFEN1pQMWVkZE0&authuser=0
Solution
#include<stdio.h>
main()
{
int i;
float avg=0;
for(i=0;i<10;i++)
{
float val;
printf("enter the measurement value ");
scanf("%f",&val);
avg = ((i*avg)+val)/(i+1);
printf("currunt value of the running average = %f ",avg);
}
}
I/P:
-68.41
94.11
91.42
-2.9
60.04
-71.66
-60.12
6.06
58.44
-6.92
O/P:

More Related Content

More from rtodd409

More from rtodd409 (6)

I having problems locating the fasb-'s conceptual frameworkSolutionThe.docx
I having problems locating the fasb-'s conceptual frameworkSolutionThe.docxI having problems locating the fasb-'s conceptual frameworkSolutionThe.docx
I having problems locating the fasb-'s conceptual frameworkSolutionThe.docx
 
I have two questions regarding linked lists in C- 1) We often declare.docx
I have two questions regarding linked lists in C- 1) We often declare.docxI have two questions regarding linked lists in C- 1) We often declare.docx
I have two questions regarding linked lists in C- 1) We often declare.docx
 
I have a questions which is what could be the advantage or disadvantag.docx
I have a questions which is what could be the advantage or disadvantag.docxI have a questions which is what could be the advantage or disadvantag.docx
I have a questions which is what could be the advantage or disadvantag.docx
 
I have a sealed container that is pressurised with Nitrogen- When calc.docx
I have a sealed container that is pressurised with Nitrogen- When calc.docxI have a sealed container that is pressurised with Nitrogen- When calc.docx
I have a sealed container that is pressurised with Nitrogen- When calc.docx
 
I have a question from a Database Systems class (we have been taught w.docx
I have a question from a Database Systems class (we have been taught w.docxI have a question from a Database Systems class (we have been taught w.docx
I have a question from a Database Systems class (we have been taught w.docx
 
HW Check- Categorize materials as n or p type semiconductors- a- Zn do.docx
HW Check- Categorize materials as n or p type semiconductors- a- Zn do.docxHW Check- Categorize materials as n or p type semiconductors- a- Zn do.docx
HW Check- Categorize materials as n or p type semiconductors- a- Zn do.docx
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
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
 
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
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 

I knew how to type the formula but had troubles on looping it- Cau you.docx

  • 1. I knew how to type the formula but had troubles on looping it. Cau you show me how to do this problem? The image of this problem can be found at: https://drive.google.com/open?id=0B7WUYmW3LyL6RnFEN1pQMWVkZE0&authuser=0 Solution #include<stdio.h> main() { int i; float avg=0; for(i=0;i<10;i++) { float val; printf("enter the measurement value "); scanf("%f",&val); avg = ((i*avg)+val)/(i+1); printf("currunt value of the running average = %f ",avg); } }