SlideShare ist ein Scribd-Unternehmen logo
1 von 2
1. develop a C program to print the sum, the average, the product, the largest and the smallest of
3 integers that are input from the keyboard.
2. define an array x of size 5, using call-by-reference (that is, use pointer) to pass the array to a
function, named summation.
In main: define array, print out the array, pass the array and show the results on screen.
In function summation: take arrays from main and sum the arrays using the formula below
sum=4summation0 xi*xi
Solution
#include <stdio.h>
#include<conio.h>
void summation(int a[],int size)
{
int i;
int sum = 0;
for(i=0;i<size;i++)
{
sum = sum+ 4*a[i]*a[i];
}
printf(" Summation is %d",sum);
}
int main(void) {
// your code goes here
int a,size;
int b[] = {1,2,3};
int i =0,max = 0,min =0 ,sum = 0 ,product = 1,average = 0 ;
for(i=0;i<3;i++)
{
printf("Enter the value of %d number",i+1);
scanf("%d",&a);
if(i==0)
min = a;
sum =sum+a;
product = product*a;
if(a>=max)
max = a;
if(a<=min)
min = a;
}
average = sum/3;
printf("Sum is %d Product is %d average is %d max is %d min is %d
",sum,product,average,max,min);
size = sizeof(b)/sizeof(b[1]);
printf("Array Content ");
for(i=0;i<size;i++)
{
printf ("%d ",b[i]);
}
summation(b,size);
getch();
return 0;
}

Weitere ähnliche Inhalte

Ähnlich wie 1- develop a C program to print the sum- the average- the product- the.docx

B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
Write a C code to perform the following tasks In main Define an arr.pdf
Write a C code to perform the following tasks In main Define an arr.pdfWrite a C code to perform the following tasks In main Define an arr.pdf
Write a C code to perform the following tasks In main Define an arr.pdffabmallkochi
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1Zaibi Gondal
 
PCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfPCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfAshutoshprasad27
 
PCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxPCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxAshutoshprasad27
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxgerardkortney
 
Chapter 3 - Variable Memory Concept
Chapter 3 - Variable Memory ConceptChapter 3 - Variable Memory Concept
Chapter 3 - Variable Memory ConceptDeepak Singh
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7alish sha
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)Make Mannan
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
 

Ähnlich wie 1- develop a C program to print the sum- the average- the product- the.docx (20)

B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
Write a C code to perform the following tasks In main Define an arr.pdf
Write a C code to perform the following tasks In main Define an arr.pdfWrite a C code to perform the following tasks In main Define an arr.pdf
Write a C code to perform the following tasks In main Define an arr.pdf
 
10 template code program
10 template code program10 template code program
10 template code program
 
Programming in c
Programming in cProgramming in c
Programming in c
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
 
Linux_C_LabBasics.ppt
Linux_C_LabBasics.pptLinux_C_LabBasics.ppt
Linux_C_LabBasics.ppt
 
Functions
FunctionsFunctions
Functions
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 
PCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfPCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdf
 
PCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxPCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docx
 
Functions in c
Functions in cFunctions in c
Functions in c
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
 
Chapter 3 - Variable Memory Concept
Chapter 3 - Variable Memory ConceptChapter 3 - Variable Memory Concept
Chapter 3 - Variable Memory Concept
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
C Programming
C ProgrammingC Programming
C Programming
 

Mehr von jbarbara1

1- Define computer crime and list several examples of computer crime-.docx
1- Define computer crime and list several examples of computer crime-.docx1- Define computer crime and list several examples of computer crime-.docx
1- Define computer crime and list several examples of computer crime-.docxjbarbara1
 
1- Create a Visual Calculator by using winform application in Microsof.docx
1- Create a Visual Calculator by using winform application in Microsof.docx1- Create a Visual Calculator by using winform application in Microsof.docx
1- Create a Visual Calculator by using winform application in Microsof.docxjbarbara1
 
1- Consulting a periodic table- Which of the six cations studied are f.docx
1- Consulting a periodic table- Which of the six cations studied are f.docx1- Consulting a periodic table- Which of the six cations studied are f.docx
1- Consulting a periodic table- Which of the six cations studied are f.docxjbarbara1
 
1- Briefly state the difference between single stage and multistage di.docx
1- Briefly state the difference between single stage and multistage di.docx1- Briefly state the difference between single stage and multistage di.docx
1- Briefly state the difference between single stage and multistage di.docxjbarbara1
 
1- A polar section of a molecule- which is---Select--- to water- is ca.docx
1- A polar section of a molecule- which is---Select--- to water- is ca.docx1- A polar section of a molecule- which is---Select--- to water- is ca.docx
1- A polar section of a molecule- which is---Select--- to water- is ca.docxjbarbara1
 
1) Is technology the critical driver of globalization- 2) What is the.docx
1) Is technology the critical driver of globalization- 2) What is the.docx1) Is technology the critical driver of globalization- 2) What is the.docx
1) Is technology the critical driver of globalization- 2) What is the.docxjbarbara1
 
1) What creates the US federal government-wide financial statements- 2.docx
1) What creates the US federal government-wide financial statements- 2.docx1) What creates the US federal government-wide financial statements- 2.docx
1) What creates the US federal government-wide financial statements- 2.docxjbarbara1
 
1) describe how temperature influenced what materials condensed from t.docx
1) describe how temperature influenced what materials condensed from t.docx1) describe how temperature influenced what materials condensed from t.docx
1) describe how temperature influenced what materials condensed from t.docxjbarbara1
 
1- People- places- things- ideas and forces are what part of speech- V.docx
1- People- places- things- ideas and forces are what part of speech- V.docx1- People- places- things- ideas and forces are what part of speech- V.docx
1- People- places- things- ideas and forces are what part of speech- V.docxjbarbara1
 
1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx
1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx
1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docxjbarbara1
 
1- How are budgets used for a company or in government- What would you.docx
1- How are budgets used for a company or in government- What would you.docx1- How are budgets used for a company or in government- What would you.docx
1- How are budgets used for a company or in government- What would you.docxjbarbara1
 
1- How are temperature and heat different concepts- 2- How does the sp.docx
1- How are temperature and heat different concepts- 2- How does the sp.docx1- How are temperature and heat different concepts- 2- How does the sp.docx
1- How are temperature and heat different concepts- 2- How does the sp.docxjbarbara1
 
1- According to the career opportunities on their websites- what are s.docx
1- According to the career opportunities on their websites- what are s.docx1- According to the career opportunities on their websites- what are s.docx
1- According to the career opportunities on their websites- what are s.docxjbarbara1
 
Which is the stronger acid in the following pair- Explain your reasoni.docx
Which is the stronger acid in the following pair- Explain your reasoni.docxWhich is the stronger acid in the following pair- Explain your reasoni.docx
Which is the stronger acid in the following pair- Explain your reasoni.docxjbarbara1
 
Which is NOT true for solute retention- A) Retention time- tr- is the.docx
Which is NOT true for solute retention- A) Retention time- tr- is the.docxWhich is NOT true for solute retention- A) Retention time- tr- is the.docx
Which is NOT true for solute retention- A) Retention time- tr- is the.docxjbarbara1
 
Which form type displays records in a tabular format similar to a Data.docx
Which form type displays records in a tabular format similar to a Data.docxWhich form type displays records in a tabular format similar to a Data.docx
Which form type displays records in a tabular format similar to a Data.docxjbarbara1
 
which equation best represents the net ionic reaction that occurs when.docx
which equation best represents the net ionic reaction that occurs when.docxwhich equation best represents the net ionic reaction that occurs when.docx
which equation best represents the net ionic reaction that occurs when.docxjbarbara1
 
Which complex in the electron transport chain does not contribute to t.docx
Which complex in the electron transport chain does not contribute to t.docxWhich complex in the electron transport chain does not contribute to t.docx
Which complex in the electron transport chain does not contribute to t.docxjbarbara1
 
where heat is transfer high in conduction or convection where heat i.docx
where heat is transfer high in conduction or convection   where heat i.docxwhere heat is transfer high in conduction or convection   where heat i.docx
where heat is transfer high in conduction or convection where heat i.docxjbarbara1
 
Where do most college students exist on Maslow-'s hierarchy of needs-.docx
Where do most college students exist on Maslow-'s hierarchy of needs-.docxWhere do most college students exist on Maslow-'s hierarchy of needs-.docx
Where do most college students exist on Maslow-'s hierarchy of needs-.docxjbarbara1
 

Mehr von jbarbara1 (20)

1- Define computer crime and list several examples of computer crime-.docx
1- Define computer crime and list several examples of computer crime-.docx1- Define computer crime and list several examples of computer crime-.docx
1- Define computer crime and list several examples of computer crime-.docx
 
1- Create a Visual Calculator by using winform application in Microsof.docx
1- Create a Visual Calculator by using winform application in Microsof.docx1- Create a Visual Calculator by using winform application in Microsof.docx
1- Create a Visual Calculator by using winform application in Microsof.docx
 
1- Consulting a periodic table- Which of the six cations studied are f.docx
1- Consulting a periodic table- Which of the six cations studied are f.docx1- Consulting a periodic table- Which of the six cations studied are f.docx
1- Consulting a periodic table- Which of the six cations studied are f.docx
 
1- Briefly state the difference between single stage and multistage di.docx
1- Briefly state the difference between single stage and multistage di.docx1- Briefly state the difference between single stage and multistage di.docx
1- Briefly state the difference between single stage and multistage di.docx
 
1- A polar section of a molecule- which is---Select--- to water- is ca.docx
1- A polar section of a molecule- which is---Select--- to water- is ca.docx1- A polar section of a molecule- which is---Select--- to water- is ca.docx
1- A polar section of a molecule- which is---Select--- to water- is ca.docx
 
1) Is technology the critical driver of globalization- 2) What is the.docx
1) Is technology the critical driver of globalization- 2) What is the.docx1) Is technology the critical driver of globalization- 2) What is the.docx
1) Is technology the critical driver of globalization- 2) What is the.docx
 
1) What creates the US federal government-wide financial statements- 2.docx
1) What creates the US federal government-wide financial statements- 2.docx1) What creates the US federal government-wide financial statements- 2.docx
1) What creates the US federal government-wide financial statements- 2.docx
 
1) describe how temperature influenced what materials condensed from t.docx
1) describe how temperature influenced what materials condensed from t.docx1) describe how temperature influenced what materials condensed from t.docx
1) describe how temperature influenced what materials condensed from t.docx
 
1- People- places- things- ideas and forces are what part of speech- V.docx
1- People- places- things- ideas and forces are what part of speech- V.docx1- People- places- things- ideas and forces are what part of speech- V.docx
1- People- places- things- ideas and forces are what part of speech- V.docx
 
1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx
1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx
1- In the context of DNS (a) What are the Resource Records- RR- (b) Wh.docx
 
1- How are budgets used for a company or in government- What would you.docx
1- How are budgets used for a company or in government- What would you.docx1- How are budgets used for a company or in government- What would you.docx
1- How are budgets used for a company or in government- What would you.docx
 
1- How are temperature and heat different concepts- 2- How does the sp.docx
1- How are temperature and heat different concepts- 2- How does the sp.docx1- How are temperature and heat different concepts- 2- How does the sp.docx
1- How are temperature and heat different concepts- 2- How does the sp.docx
 
1- According to the career opportunities on their websites- what are s.docx
1- According to the career opportunities on their websites- what are s.docx1- According to the career opportunities on their websites- what are s.docx
1- According to the career opportunities on their websites- what are s.docx
 
Which is the stronger acid in the following pair- Explain your reasoni.docx
Which is the stronger acid in the following pair- Explain your reasoni.docxWhich is the stronger acid in the following pair- Explain your reasoni.docx
Which is the stronger acid in the following pair- Explain your reasoni.docx
 
Which is NOT true for solute retention- A) Retention time- tr- is the.docx
Which is NOT true for solute retention- A) Retention time- tr- is the.docxWhich is NOT true for solute retention- A) Retention time- tr- is the.docx
Which is NOT true for solute retention- A) Retention time- tr- is the.docx
 
Which form type displays records in a tabular format similar to a Data.docx
Which form type displays records in a tabular format similar to a Data.docxWhich form type displays records in a tabular format similar to a Data.docx
Which form type displays records in a tabular format similar to a Data.docx
 
which equation best represents the net ionic reaction that occurs when.docx
which equation best represents the net ionic reaction that occurs when.docxwhich equation best represents the net ionic reaction that occurs when.docx
which equation best represents the net ionic reaction that occurs when.docx
 
Which complex in the electron transport chain does not contribute to t.docx
Which complex in the electron transport chain does not contribute to t.docxWhich complex in the electron transport chain does not contribute to t.docx
Which complex in the electron transport chain does not contribute to t.docx
 
where heat is transfer high in conduction or convection where heat i.docx
where heat is transfer high in conduction or convection   where heat i.docxwhere heat is transfer high in conduction or convection   where heat i.docx
where heat is transfer high in conduction or convection where heat i.docx
 
Where do most college students exist on Maslow-'s hierarchy of needs-.docx
Where do most college students exist on Maslow-'s hierarchy of needs-.docxWhere do most college students exist on Maslow-'s hierarchy of needs-.docx
Where do most college students exist on Maslow-'s hierarchy of needs-.docx
 

Kürzlich hochgeladen

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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 . pdfQucHHunhnh
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Kürzlich hochgeladen (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

1- develop a C program to print the sum- the average- the product- the.docx

  • 1. 1. develop a C program to print the sum, the average, the product, the largest and the smallest of 3 integers that are input from the keyboard. 2. define an array x of size 5, using call-by-reference (that is, use pointer) to pass the array to a function, named summation. In main: define array, print out the array, pass the array and show the results on screen. In function summation: take arrays from main and sum the arrays using the formula below sum=4summation0 xi*xi Solution #include <stdio.h> #include<conio.h> void summation(int a[],int size) { int i; int sum = 0; for(i=0;i<size;i++) { sum = sum+ 4*a[i]*a[i]; } printf(" Summation is %d",sum); } int main(void) { // your code goes here int a,size; int b[] = {1,2,3}; int i =0,max = 0,min =0 ,sum = 0 ,product = 1,average = 0 ;
  • 2. for(i=0;i<3;i++) { printf("Enter the value of %d number",i+1); scanf("%d",&a); if(i==0) min = a; sum =sum+a; product = product*a; if(a>=max) max = a; if(a<=min) min = a; } average = sum/3; printf("Sum is %d Product is %d average is %d max is %d min is %d ",sum,product,average,max,min); size = sizeof(b)/sizeof(b[1]); printf("Array Content "); for(i=0;i<size;i++) { printf ("%d ",b[i]); } summation(b,size); getch(); return 0; }