SlideShare une entreprise Scribd logo
1  sur  2
What is the output of the following C++ program? #include using namespace std; void
myFunction(int&, int); int main () {int a, b; a = 5; b = 10; cout
Solution
Output :
main.cpp
#include <iostream>
using namespace std;
// function declaration
void myfunction(int&, int);
int main ()
{ int a;
int b;
a=5;
b=10;
cout<<"a="<<a<<"b="<<b<<endl;
myfunction(a, b);
cout<<"a="<<a<<"b="<<b<<endl;
return 0;
}
void myfunction(int& i, int j)
{
int a;
a=i;
i=j;
j=a;
}
Output :
What is the output of the following C++ program-  #include   using nam.docx

Contenu connexe

Plus de rtodd100

What is the significance of renaming the role of Programming Secretary.docx
What is the significance of renaming the role of Programming Secretary.docxWhat is the significance of renaming the role of Programming Secretary.docx
What is the significance of renaming the role of Programming Secretary.docxrtodd100
 
What is the primary role of internal controls in managing a busines- a.docx
What is the primary role of internal controls in managing a busines- a.docxWhat is the primary role of internal controls in managing a busines- a.docx
What is the primary role of internal controls in managing a busines- a.docxrtodd100
 
What is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docx
What is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docxWhat is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docx
What is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docxrtodd100
 
What is the pH of the buffer that results when 12-5 g sodium acetate (.docx
What is the pH of the buffer that results when 12-5 g sodium acetate (.docxWhat is the pH of the buffer that results when 12-5 g sodium acetate (.docx
What is the pH of the buffer that results when 12-5 g sodium acetate (.docxrtodd100
 
What is the magnetic field at point Q (20cm to the left of I1- 10cm to.docx
What is the magnetic field at point Q (20cm to the left of I1- 10cm to.docxWhat is the magnetic field at point Q (20cm to the left of I1- 10cm to.docx
What is the magnetic field at point Q (20cm to the left of I1- 10cm to.docxrtodd100
 
What is the final value of x after performing the following operations (1).docx
What is the final value of x after performing the following operations (1).docxWhat is the final value of x after performing the following operations (1).docx
What is the final value of x after performing the following operations (1).docxrtodd100
 
What is the difference between disk partitioning and formatting-Soluti.docx
What is the difference between disk partitioning and formatting-Soluti.docxWhat is the difference between disk partitioning and formatting-Soluti.docx
What is the difference between disk partitioning and formatting-Soluti.docxrtodd100
 
What is the difference in the TLS implementation that allows some expl.docx
What is the difference in the TLS implementation that allows some expl.docxWhat is the difference in the TLS implementation that allows some expl.docx
What is the difference in the TLS implementation that allows some expl.docxrtodd100
 
What is the difference between IS &IT- What is the difference betwee.docx
What is the difference between IS &IT-   What is the difference betwee.docxWhat is the difference between IS &IT-   What is the difference betwee.docx
What is the difference between IS &IT- What is the difference betwee.docxrtodd100
 
What is the difference between interfaced system and integrated system.docx
What is the difference between interfaced system and integrated system.docxWhat is the difference between interfaced system and integrated system.docx
What is the difference between interfaced system and integrated system.docxrtodd100
 
what is the difference between a single beam spectrophotometer and a d.docx
what is the difference between a single beam spectrophotometer and a d.docxwhat is the difference between a single beam spectrophotometer and a d.docx
what is the difference between a single beam spectrophotometer and a d.docxrtodd100
 
What is the difference between the formation of an ionic bond and form.docx
What is the difference between the formation of an ionic bond and form.docxWhat is the difference between the formation of an ionic bond and form.docx
What is the difference between the formation of an ionic bond and form.docxrtodd100
 
What is the difference between a direct and indirect interaction devic.docx
What is the difference between a direct and indirect interaction devic.docxWhat is the difference between a direct and indirect interaction devic.docx
What is the difference between a direct and indirect interaction devic.docxrtodd100
 
what is the difference an organic and inorganic moleculeSolutionCompou.docx
what is the difference an organic and inorganic moleculeSolutionCompou.docxwhat is the difference an organic and inorganic moleculeSolutionCompou.docx
what is the difference an organic and inorganic moleculeSolutionCompou.docxrtodd100
 
What is the conjugate base of H2SO4- What is the conjugate base of H.docx
What is the conjugate base of H2SO4-   What is the conjugate base of H.docxWhat is the conjugate base of H2SO4-   What is the conjugate base of H.docx
What is the conjugate base of H2SO4- What is the conjugate base of H.docxrtodd100
 

Plus de rtodd100 (15)

What is the significance of renaming the role of Programming Secretary.docx
What is the significance of renaming the role of Programming Secretary.docxWhat is the significance of renaming the role of Programming Secretary.docx
What is the significance of renaming the role of Programming Secretary.docx
 
What is the primary role of internal controls in managing a busines- a.docx
What is the primary role of internal controls in managing a busines- a.docxWhat is the primary role of internal controls in managing a busines- a.docx
What is the primary role of internal controls in managing a busines- a.docx
 
What is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docx
What is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docxWhat is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docx
What is the pH of a saturated solution of Zn(OH)2 Ksp - 1-1-10-21- Sol.docx
 
What is the pH of the buffer that results when 12-5 g sodium acetate (.docx
What is the pH of the buffer that results when 12-5 g sodium acetate (.docxWhat is the pH of the buffer that results when 12-5 g sodium acetate (.docx
What is the pH of the buffer that results when 12-5 g sodium acetate (.docx
 
What is the magnetic field at point Q (20cm to the left of I1- 10cm to.docx
What is the magnetic field at point Q (20cm to the left of I1- 10cm to.docxWhat is the magnetic field at point Q (20cm to the left of I1- 10cm to.docx
What is the magnetic field at point Q (20cm to the left of I1- 10cm to.docx
 
What is the final value of x after performing the following operations (1).docx
What is the final value of x after performing the following operations (1).docxWhat is the final value of x after performing the following operations (1).docx
What is the final value of x after performing the following operations (1).docx
 
What is the difference between disk partitioning and formatting-Soluti.docx
What is the difference between disk partitioning and formatting-Soluti.docxWhat is the difference between disk partitioning and formatting-Soluti.docx
What is the difference between disk partitioning and formatting-Soluti.docx
 
What is the difference in the TLS implementation that allows some expl.docx
What is the difference in the TLS implementation that allows some expl.docxWhat is the difference in the TLS implementation that allows some expl.docx
What is the difference in the TLS implementation that allows some expl.docx
 
What is the difference between IS &IT- What is the difference betwee.docx
What is the difference between IS &IT-   What is the difference betwee.docxWhat is the difference between IS &IT-   What is the difference betwee.docx
What is the difference between IS &IT- What is the difference betwee.docx
 
What is the difference between interfaced system and integrated system.docx
What is the difference between interfaced system and integrated system.docxWhat is the difference between interfaced system and integrated system.docx
What is the difference between interfaced system and integrated system.docx
 
what is the difference between a single beam spectrophotometer and a d.docx
what is the difference between a single beam spectrophotometer and a d.docxwhat is the difference between a single beam spectrophotometer and a d.docx
what is the difference between a single beam spectrophotometer and a d.docx
 
What is the difference between the formation of an ionic bond and form.docx
What is the difference between the formation of an ionic bond and form.docxWhat is the difference between the formation of an ionic bond and form.docx
What is the difference between the formation of an ionic bond and form.docx
 
What is the difference between a direct and indirect interaction devic.docx
What is the difference between a direct and indirect interaction devic.docxWhat is the difference between a direct and indirect interaction devic.docx
What is the difference between a direct and indirect interaction devic.docx
 
what is the difference an organic and inorganic moleculeSolutionCompou.docx
what is the difference an organic and inorganic moleculeSolutionCompou.docxwhat is the difference an organic and inorganic moleculeSolutionCompou.docx
what is the difference an organic and inorganic moleculeSolutionCompou.docx
 
What is the conjugate base of H2SO4- What is the conjugate base of H.docx
What is the conjugate base of H2SO4-   What is the conjugate base of H.docxWhat is the conjugate base of H2SO4-   What is the conjugate base of H.docx
What is the conjugate base of H2SO4- What is the conjugate base of H.docx
 

Dernier

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
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.MaryamAhmad92
 
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
 
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
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
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
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
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.pptxMaritesTamaniVerdade
 

Dernier (20)

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
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.
 
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
 
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
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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
 

What is the output of the following C++ program- #include using nam.docx

  • 1. What is the output of the following C++ program? #include using namespace std; void myFunction(int&, int); int main () {int a, b; a = 5; b = 10; cout Solution Output : main.cpp #include <iostream> using namespace std; // function declaration void myfunction(int&, int); int main () { int a; int b; a=5; b=10; cout<<"a="<<a<<"b="<<b<<endl; myfunction(a, b); cout<<"a="<<a<<"b="<<b<<endl; return 0; } void myfunction(int& i, int j) { int a; a=i; i=j; j=a; } Output :