SlideShare a Scribd company logo
1 of 2
Download to read offline
program:
#include
using namespace std;
void calculations(double[], int);
void output(double[], int);
int main()
{
// variables declared
const int arraysize = 50;
double numbers[arraysize];
// calling the functions
calculations(numbers, arraysize);
output(numbers, arraysize);
return 0;
}
void calculations(double nums[], int size) {
for (int index = 0; index < 25; index++)
nums[index] = index * index;
for (int index = 25; index < size; index++)
nums[index] = 3 * index;
}
void output(double nums[], int size) {
int count = 0;
for (int i = 0; i < size; i++) {
cout << nums[i] << " ";
++count;
if (count % 10 == 0)
cout << endl;
}
}
Solution
program:
#include
using namespace std;
void calculations(double[], int);
void output(double[], int);
int main()
{
// variables declared
const int arraysize = 50;
double numbers[arraysize];
// calling the functions
calculations(numbers, arraysize);
output(numbers, arraysize);
return 0;
}
void calculations(double nums[], int size) {
for (int index = 0; index < 25; index++)
nums[index] = index * index;
for (int index = 25; index < size; index++)
nums[index] = 3 * index;
}
void output(double nums[], int size) {
int count = 0;
for (int i = 0; i < size; i++) {
cout << nums[i] << " ";
++count;
if (count % 10 == 0)
cout << endl;
}
}

More Related Content

Similar to program#include iostreamusing namespace std;void calculatio.pdf

Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings imtiazalijoono
 
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
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2Mouna Guru
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfaathiauto
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacionJeff Tu Pechito
 
Array and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptxArray and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptxJumanneChiyanda
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointersMomenMostafa
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answersQuratulain Naqvi
 
M|18 User Defined Functions
M|18 User Defined FunctionsM|18 User Defined Functions
M|18 User Defined FunctionsMariaDB plc
 
Binary addition using class concept in c++
Binary addition using class concept in c++Binary addition using class concept in c++
Binary addition using class concept in c++Swarup Boro
 
ParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdfParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdfChen-Hung Hu
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
 
An object of class StatCalc can be used to compute several simp.pdf
 An object of class StatCalc can be used to compute several simp.pdf An object of class StatCalc can be used to compute several simp.pdf
An object of class StatCalc can be used to compute several simp.pdfaravlitraders2012
 

Similar to program#include iostreamusing namespace std;void calculatio.pdf (20)

Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
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
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Embedded C - Day 2
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
 
Array Cont
Array ContArray Cont
Array Cont
 
python.pdf
python.pdfpython.pdf
python.pdf
 
COM1407: Arrays
COM1407: ArraysCOM1407: Arrays
COM1407: Arrays
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacion
 
DSC program.pdf
DSC program.pdfDSC program.pdf
DSC program.pdf
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Array and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptxArray and string in C++_093547 analysis.pptx
Array and string in C++_093547 analysis.pptx
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointers
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answers
 
M|18 User Defined Functions
M|18 User Defined FunctionsM|18 User Defined Functions
M|18 User Defined Functions
 
Binary addition using class concept in c++
Binary addition using class concept in c++Binary addition using class concept in c++
Binary addition using class concept in c++
 
ParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdfParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdf
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
An object of class StatCalc can be used to compute several simp.pdf
 An object of class StatCalc can be used to compute several simp.pdf An object of class StatCalc can be used to compute several simp.pdf
An object of class StatCalc can be used to compute several simp.pdf
 

More from info382133

1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf
1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf
1.) Main characteristics of Haloarchaea are as followsHalophiles .pdfinfo382133
 
1. The three bacteria that may be implicated in the given case are S.pdf
1. The three bacteria that may be implicated in the given case are S.pdf1. The three bacteria that may be implicated in the given case are S.pdf
1. The three bacteria that may be implicated in the given case are S.pdfinfo382133
 
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdfinfo382133
 
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdfinfo382133
 
Rf = (distance the spot traveled)L there are fou.pdf
                     Rf = (distance the spot traveled)L there are fou.pdf                     Rf = (distance the spot traveled)L there are fou.pdf
Rf = (distance the spot traveled)L there are fou.pdfinfo382133
 
No. Since sodium chloride is an ionic compound, i.pdf
                     No. Since sodium chloride is an ionic compound, i.pdf                     No. Since sodium chloride is an ionic compound, i.pdf
No. Since sodium chloride is an ionic compound, i.pdfinfo382133
 
Nacl is highly ionic in nature. where as CaO is s.pdf
                     Nacl is highly ionic in nature. where as CaO is s.pdf                     Nacl is highly ionic in nature. where as CaO is s.pdf
Nacl is highly ionic in nature. where as CaO is s.pdfinfo382133
 
it is reduced as it accepts e- and goes from 0 to.pdf
                     it is reduced as it accepts e- and goes from 0 to.pdf                     it is reduced as it accepts e- and goes from 0 to.pdf
it is reduced as it accepts e- and goes from 0 to.pdfinfo382133
 
Iodine test is used to see if a compound has star.pdf
                     Iodine test is used to see if a compound has star.pdf                     Iodine test is used to see if a compound has star.pdf
Iodine test is used to see if a compound has star.pdfinfo382133
 
I have no clue! .pdf
                     I have no clue!                                  .pdf                     I have no clue!                                  .pdf
I have no clue! .pdfinfo382133
 
C only III is major product .pdf
                     C only III is major product                      .pdf                     C only III is major product                      .pdf
C only III is major product .pdfinfo382133
 
Borane-THF is flammable and highly reactive with .pdf
                     Borane-THF is flammable and highly reactive with .pdf                     Borane-THF is flammable and highly reactive with .pdf
Borane-THF is flammable and highly reactive with .pdfinfo382133
 
Ubiquity Internet is available everywhere namely at home, at work v.pdf
Ubiquity Internet is available everywhere namely at home, at work v.pdfUbiquity Internet is available everywhere namely at home, at work v.pdf
Ubiquity Internet is available everywhere namely at home, at work v.pdfinfo382133
 
Water is the most used resource in our day to day life . When the wa.pdf
Water is the most used resource in our day to day life . When the wa.pdfWater is the most used resource in our day to day life . When the wa.pdf
Water is the most used resource in our day to day life . When the wa.pdfinfo382133
 
The initiation of the sporulation of the bacteria is a complex cellu.pdf
The initiation of the sporulation of the bacteria is a complex cellu.pdfThe initiation of the sporulation of the bacteria is a complex cellu.pdf
The initiation of the sporulation of the bacteria is a complex cellu.pdfinfo382133
 
The emissivity of a given surface is the measure of its ability to e.pdf
The emissivity of a given surface is the measure of its ability to e.pdfThe emissivity of a given surface is the measure of its ability to e.pdf
The emissivity of a given surface is the measure of its ability to e.pdfinfo382133
 
Power set={SolutionPower set={.pdf
Power set={SolutionPower set={.pdfPower set={SolutionPower set={.pdf
Power set={SolutionPower set={.pdfinfo382133
 
bro Solutionbro .pdf
bro Solutionbro .pdfbro Solutionbro .pdf
bro Solutionbro .pdfinfo382133
 
ANSWER Accounting concepts and conventions In dr.pdf
                     ANSWER Accounting concepts and conventions  In dr.pdf                     ANSWER Accounting concepts and conventions  In dr.pdf
ANSWER Accounting concepts and conventions In dr.pdfinfo382133
 
As ions are charged species a strong interactions.pdf
                     As ions are charged species a strong interactions.pdf                     As ions are charged species a strong interactions.pdf
As ions are charged species a strong interactions.pdfinfo382133
 

More from info382133 (20)

1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf
1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf
1.) Main characteristics of Haloarchaea are as followsHalophiles .pdf
 
1. The three bacteria that may be implicated in the given case are S.pdf
1. The three bacteria that may be implicated in the given case are S.pdf1. The three bacteria that may be implicated in the given case are S.pdf
1. The three bacteria that may be implicated in the given case are S.pdf
 
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdf
 
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdf
 
Rf = (distance the spot traveled)L there are fou.pdf
                     Rf = (distance the spot traveled)L there are fou.pdf                     Rf = (distance the spot traveled)L there are fou.pdf
Rf = (distance the spot traveled)L there are fou.pdf
 
No. Since sodium chloride is an ionic compound, i.pdf
                     No. Since sodium chloride is an ionic compound, i.pdf                     No. Since sodium chloride is an ionic compound, i.pdf
No. Since sodium chloride is an ionic compound, i.pdf
 
Nacl is highly ionic in nature. where as CaO is s.pdf
                     Nacl is highly ionic in nature. where as CaO is s.pdf                     Nacl is highly ionic in nature. where as CaO is s.pdf
Nacl is highly ionic in nature. where as CaO is s.pdf
 
it is reduced as it accepts e- and goes from 0 to.pdf
                     it is reduced as it accepts e- and goes from 0 to.pdf                     it is reduced as it accepts e- and goes from 0 to.pdf
it is reduced as it accepts e- and goes from 0 to.pdf
 
Iodine test is used to see if a compound has star.pdf
                     Iodine test is used to see if a compound has star.pdf                     Iodine test is used to see if a compound has star.pdf
Iodine test is used to see if a compound has star.pdf
 
I have no clue! .pdf
                     I have no clue!                                  .pdf                     I have no clue!                                  .pdf
I have no clue! .pdf
 
C only III is major product .pdf
                     C only III is major product                      .pdf                     C only III is major product                      .pdf
C only III is major product .pdf
 
Borane-THF is flammable and highly reactive with .pdf
                     Borane-THF is flammable and highly reactive with .pdf                     Borane-THF is flammable and highly reactive with .pdf
Borane-THF is flammable and highly reactive with .pdf
 
Ubiquity Internet is available everywhere namely at home, at work v.pdf
Ubiquity Internet is available everywhere namely at home, at work v.pdfUbiquity Internet is available everywhere namely at home, at work v.pdf
Ubiquity Internet is available everywhere namely at home, at work v.pdf
 
Water is the most used resource in our day to day life . When the wa.pdf
Water is the most used resource in our day to day life . When the wa.pdfWater is the most used resource in our day to day life . When the wa.pdf
Water is the most used resource in our day to day life . When the wa.pdf
 
The initiation of the sporulation of the bacteria is a complex cellu.pdf
The initiation of the sporulation of the bacteria is a complex cellu.pdfThe initiation of the sporulation of the bacteria is a complex cellu.pdf
The initiation of the sporulation of the bacteria is a complex cellu.pdf
 
The emissivity of a given surface is the measure of its ability to e.pdf
The emissivity of a given surface is the measure of its ability to e.pdfThe emissivity of a given surface is the measure of its ability to e.pdf
The emissivity of a given surface is the measure of its ability to e.pdf
 
Power set={SolutionPower set={.pdf
Power set={SolutionPower set={.pdfPower set={SolutionPower set={.pdf
Power set={SolutionPower set={.pdf
 
bro Solutionbro .pdf
bro Solutionbro .pdfbro Solutionbro .pdf
bro Solutionbro .pdf
 
ANSWER Accounting concepts and conventions In dr.pdf
                     ANSWER Accounting concepts and conventions  In dr.pdf                     ANSWER Accounting concepts and conventions  In dr.pdf
ANSWER Accounting concepts and conventions In dr.pdf
 
As ions are charged species a strong interactions.pdf
                     As ions are charged species a strong interactions.pdf                     As ions are charged species a strong interactions.pdf
As ions are charged species a strong interactions.pdf
 

Recently uploaded

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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 Delhikauryashika82
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
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
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
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
 
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.pdfQucHHunhnh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
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 17Celine George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
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
 
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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

program#include iostreamusing namespace std;void calculatio.pdf

  • 1. program: #include using namespace std; void calculations(double[], int); void output(double[], int); int main() { // variables declared const int arraysize = 50; double numbers[arraysize]; // calling the functions calculations(numbers, arraysize); output(numbers, arraysize); return 0; } void calculations(double nums[], int size) { for (int index = 0; index < 25; index++) nums[index] = index * index; for (int index = 25; index < size; index++) nums[index] = 3 * index; } void output(double nums[], int size) { int count = 0; for (int i = 0; i < size; i++) { cout << nums[i] << " "; ++count; if (count % 10 == 0) cout << endl; } } Solution program: #include
  • 2. using namespace std; void calculations(double[], int); void output(double[], int); int main() { // variables declared const int arraysize = 50; double numbers[arraysize]; // calling the functions calculations(numbers, arraysize); output(numbers, arraysize); return 0; } void calculations(double nums[], int size) { for (int index = 0; index < 25; index++) nums[index] = index * index; for (int index = 25; index < size; index++) nums[index] = 3 * index; } void output(double nums[], int size) { int count = 0; for (int i = 0; i < size; i++) { cout << nums[i] << " "; ++count; if (count % 10 == 0) cout << endl; } }