SlideShare a Scribd company logo
1 of 1
Download to read offline
C++ Write a function which prompts the user for a number and returns it. Then call the function
from main() to get the number and then display it.
Solution
#include
using namespace std;
int getNumber() //function definition
{
int number;
cout<<"Enter a number : ";
cin>>number;
return number;
}
int main()
{
cout<<" The number you entered is :"<

More Related Content

More from arumugambags

What questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdfWhat questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdfarumugambags
 
What is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdfWhat is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdfarumugambags
 
What are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdfWhat are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdfarumugambags
 
What are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdfWhat are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdfarumugambags
 
We regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdfWe regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdfarumugambags
 
A father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdfA father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdfarumugambags
 
The purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdfThe purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdfarumugambags
 
The mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdfThe mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdfarumugambags
 
The firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdfThe firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdfarumugambags
 
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdfarumugambags
 
Researchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdfResearchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdfarumugambags
 
No observed sexual phase in its life cycle Resistant sporangium prod.pdf
No observed sexual phase in its life cycle  Resistant sporangium prod.pdfNo observed sexual phase in its life cycle  Resistant sporangium prod.pdf
No observed sexual phase in its life cycle Resistant sporangium prod.pdfarumugambags
 
Problem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdfProblem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdfarumugambags
 
Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdf
Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdfPixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdf
Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdfarumugambags
 
On the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdfOn the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdfarumugambags
 
List the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdfList the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdfarumugambags
 
2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdf2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdfarumugambags
 
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdfarumugambags
 
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdfJanuary 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdfarumugambags
 
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdfIPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdfarumugambags
 

More from arumugambags (20)

What questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdfWhat questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdf
 
What is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdfWhat is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdf
 
What are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdfWhat are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdf
 
What are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdfWhat are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdf
 
We regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdfWe regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdf
 
A father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdfA father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdf
 
The purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdfThe purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdf
 
The mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdfThe mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdf
 
The firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdfThe firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdf
 
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
 
Researchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdfResearchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdf
 
No observed sexual phase in its life cycle Resistant sporangium prod.pdf
No observed sexual phase in its life cycle  Resistant sporangium prod.pdfNo observed sexual phase in its life cycle  Resistant sporangium prod.pdf
No observed sexual phase in its life cycle Resistant sporangium prod.pdf
 
Problem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdfProblem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdf
 
Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdf
Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdfPixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdf
Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdf
 
On the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdfOn the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdf
 
List the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdfList the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdf
 
2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdf2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdf
 
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
 
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdfJanuary 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
 
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdfIPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
 

Recently uploaded

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
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
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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
 
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
 
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
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
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
 
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
 
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
 
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
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
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"
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
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
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).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
 
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
 
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
 
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
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
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"
 
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
 
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...
 
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
 
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
 

C++ Write a function which prompts the user for a number and return.pdf

  • 1. C++ Write a function which prompts the user for a number and returns it. Then call the function from main() to get the number and then display it. Solution #include using namespace std; int getNumber() //function definition { int number; cout<<"Enter a number : "; cin>>number; return number; } int main() { cout<<" The number you entered is :"<