SlideShare a Scribd company logo
1 of 1
Download to read offline
C++ Write a function that takes two numbers are parameters and returns their product. Create a
program that program the prompts for to numbers, then uses this function calcuate the product,
and then displays the product.
Solution
#include
using namespace std;
int product(int number1,int number2) //function to compute product of two numbers
{
return (number1 * number2); //return product
}
int main()
{
int num1,num2;
cout<<"Enter two numbers";
cin>>num1>>num2;
cout<<" Product of "<

More Related Content

More from fortmdu

Disneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdfDisneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdffortmdu
 
Discuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdfDiscuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdffortmdu
 
Describe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdfDescribe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdffortmdu
 
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdfCASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdffortmdu
 
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdfB.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdffortmdu
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdffortmdu
 
You maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdfYou maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdffortmdu
 
Which of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdfWhich of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdffortmdu
 
You are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdfYou are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdffortmdu
 
You are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdfYou are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdffortmdu
 
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdf
X = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdfX = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdf
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdffortmdu
 
Tic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdf
Tic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdfTic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdf
Tic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdffortmdu
 
Which substance has ionic bondsLiIH2ONH3Br2Which sub.pdf
Which substance has ionic bondsLiIH2ONH3Br2Which sub.pdfWhich substance has ionic bondsLiIH2ONH3Br2Which sub.pdf
Which substance has ionic bondsLiIH2ONH3Br2Which sub.pdffortmdu
 
What is a culture A subculture Give an example of each.Solutio.pdf
What is a culture A subculture Give an example of each.Solutio.pdfWhat is a culture A subculture Give an example of each.Solutio.pdf
What is a culture A subculture Give an example of each.Solutio.pdffortmdu
 
The last major idea in population dynamics is the idea of a minimum .pdf
The last major idea in population dynamics is the idea of a minimum .pdfThe last major idea in population dynamics is the idea of a minimum .pdf
The last major idea in population dynamics is the idea of a minimum .pdffortmdu
 
Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdf
Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdfPython ProgramDo not use import please. Problem 1 Rolodex (Note .pdf
Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdffortmdu
 
The partial pressure of oxygen in the alveolar gas is affected by cer.pdf
The partial pressure of oxygen in the alveolar gas is affected by cer.pdfThe partial pressure of oxygen in the alveolar gas is affected by cer.pdf
The partial pressure of oxygen in the alveolar gas is affected by cer.pdffortmdu
 
QUESTION 8____ are considered to be product or service market stak.pdf
QUESTION 8____ are considered to be product or service market stak.pdfQUESTION 8____ are considered to be product or service market stak.pdf
QUESTION 8____ are considered to be product or service market stak.pdffortmdu
 
A student had a set of solutions labeled A-E which contained in no o.pdf
A student had a set of solutions labeled A-E which contained in no o.pdfA student had a set of solutions labeled A-E which contained in no o.pdf
A student had a set of solutions labeled A-E which contained in no o.pdffortmdu
 
A small insect viewed through a convex lens is 1.2 cm from the lens a.pdf
A small insect viewed through a convex lens is 1.2 cm from the lens a.pdfA small insect viewed through a convex lens is 1.2 cm from the lens a.pdf
A small insect viewed through a convex lens is 1.2 cm from the lens a.pdffortmdu
 

More from fortmdu (20)

Disneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdfDisneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdf
 
Discuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdfDiscuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdf
 
Describe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdfDescribe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdf
 
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdfCASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
 
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdfB.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
 
You maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdfYou maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdf
 
Which of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdfWhich of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdf
 
You are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdfYou are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdf
 
You are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdfYou are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdf
 
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdf
X = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdfX = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdf
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdf
 
Tic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdf
Tic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdfTic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdf
Tic-Tac-Toe Simulator [C# Visual Basic] Create an application th.pdf
 
Which substance has ionic bondsLiIH2ONH3Br2Which sub.pdf
Which substance has ionic bondsLiIH2ONH3Br2Which sub.pdfWhich substance has ionic bondsLiIH2ONH3Br2Which sub.pdf
Which substance has ionic bondsLiIH2ONH3Br2Which sub.pdf
 
What is a culture A subculture Give an example of each.Solutio.pdf
What is a culture A subculture Give an example of each.Solutio.pdfWhat is a culture A subculture Give an example of each.Solutio.pdf
What is a culture A subculture Give an example of each.Solutio.pdf
 
The last major idea in population dynamics is the idea of a minimum .pdf
The last major idea in population dynamics is the idea of a minimum .pdfThe last major idea in population dynamics is the idea of a minimum .pdf
The last major idea in population dynamics is the idea of a minimum .pdf
 
Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdf
Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdfPython ProgramDo not use import please. Problem 1 Rolodex (Note .pdf
Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdf
 
The partial pressure of oxygen in the alveolar gas is affected by cer.pdf
The partial pressure of oxygen in the alveolar gas is affected by cer.pdfThe partial pressure of oxygen in the alveolar gas is affected by cer.pdf
The partial pressure of oxygen in the alveolar gas is affected by cer.pdf
 
QUESTION 8____ are considered to be product or service market stak.pdf
QUESTION 8____ are considered to be product or service market stak.pdfQUESTION 8____ are considered to be product or service market stak.pdf
QUESTION 8____ are considered to be product or service market stak.pdf
 
A student had a set of solutions labeled A-E which contained in no o.pdf
A student had a set of solutions labeled A-E which contained in no o.pdfA student had a set of solutions labeled A-E which contained in no o.pdf
A student had a set of solutions labeled A-E which contained in no o.pdf
 
A small insect viewed through a convex lens is 1.2 cm from the lens a.pdf
A small insect viewed through a convex lens is 1.2 cm from the lens a.pdfA small insect viewed through a convex lens is 1.2 cm from the lens a.pdf
A small insect viewed through a convex lens is 1.2 cm from the lens a.pdf
 

Recently uploaded

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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
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
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
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
 
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
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
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
 

Recently uploaded (20)

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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
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
 
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...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
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
 

C++ Write a function that takes two numbers are parameters and retu.pdf

  • 1. C++ Write a function that takes two numbers are parameters and returns their product. Create a program that program the prompts for to numbers, then uses this function calcuate the product, and then displays the product. Solution #include using namespace std; int product(int number1,int number2) //function to compute product of two numbers { return (number1 * number2); //return product } int main() { int num1,num2; cout<<"Enter two numbers"; cin>>num1>>num2; cout<<" Product of "<