SlideShare a Scribd company logo

Write a program to compute the volume V of a cylinder of radius r and (1).docx

D
D

Write a program to compute the volume V of a cylinder of radius r and height h. (Recall that V = r2h.) in c++ let r = 5 and h=12 and pi=3.14 Solution Volume of the cylinder is r 2 h PROGRAM: #include <iostream> #include <cmath> using namespace std; const float pi=3.14; /* defining the constant value of pi and later using it in the program */ int main() { int r=5,h=12; float volume; volume = pi * pow(r,2) * h; /* pow(x,y) is a function used to calculate the value of x y and here it is used to calculate r 2 */ cout<<\"\ \ Volume of the cylinder is \"<<volume; } OUTPUT: Volume of the cylinder is 942 .

Write a program to compute the volume V of a cylinder of radius r and (1).docx

1 of 1
Download to read offline
Write a program to compute the volume V of a cylinder of radius r and height h. (Recall that V =
r2h.) in c++ let r = 5 and h=12 and pi=3.14
Solution
Volume of the cylinder is r 2 h
PROGRAM:
#include <iostream>
#include <cmath>
using namespace std;
const float pi=3.14; /* defining the constant value of pi and later using it in the program */
int main()
{
int r=5,h=12;
float volume;
volume = pi * pow(r,2) * h; /* pow(x,y) is a function used to calculate the value of x y and
here it is used to calculate r 2 */
cout<<"  Volume of the cylinder is "<<volume;
}
OUTPUT: Volume of the cylinder is 942
Ad

Recommended

Write a SIMPLE java program to print out the numbers from 100 to 1- wi.docx
Write a SIMPLE java program to print out the numbers from 100 to 1- wi.docxWrite a SIMPLE java program to print out the numbers from 100 to 1- wi.docx
Write a SIMPLE java program to print out the numbers from 100 to 1- wi.docxdrosa1
 
Write a simple c++ program that computes the value of ex by using the.docx
Write a simple c++ program that computes the value of ex by using the.docxWrite a simple c++ program that computes the value of ex by using the.docx
Write a simple c++ program that computes the value of ex by using the.docxdrosa1
 
Write a short assembly language module to be used with C++ that rotate.docx
Write a short assembly language module to be used with C++ that rotate.docxWrite a short assembly language module to be used with C++ that rotate.docx
Write a short assembly language module to be used with C++ that rotate.docxdrosa1
 
Write a short essay- between 400 and 500 words- responding to the assi.docx
Write a short essay- between 400 and 500 words- responding to the assi.docxWrite a short essay- between 400 and 500 words- responding to the assi.docx
Write a short essay- between 400 and 500 words- responding to the assi.docxdrosa1
 
Write a SELECT statement that returns the LastName and JobTitle of eac.docx
Write a SELECT statement that returns the LastName and JobTitle of eac.docxWrite a SELECT statement that returns the LastName and JobTitle of eac.docx
Write a SELECT statement that returns the LastName and JobTitle of eac.docxdrosa1
 
Write a recursive C function that counts the number of vowels in a str.docx
Write a recursive C function that counts the number of vowels in a str.docxWrite a recursive C function that counts the number of vowels in a str.docx
Write a recursive C function that counts the number of vowels in a str.docxdrosa1
 
Write a routine to reconstruct the shortest paths from the algorithm i.docx
Write a routine to reconstruct the shortest paths from the algorithm i.docxWrite a routine to reconstruct the shortest paths from the algorithm i.docx
Write a routine to reconstruct the shortest paths from the algorithm i.docxdrosa1
 
Write a program that uses a dynamic array that contains 5 items of dou.docx
Write a program that uses a dynamic array that contains 5 items of dou.docxWrite a program that uses a dynamic array that contains 5 items of dou.docx
Write a program that uses a dynamic array that contains 5 items of dou.docxdrosa1
 

More Related Content

More from drosa1

Write a recursive function to convert a character string of digits to.docx
Write a recursive function to convert a character string of digits to.docxWrite a recursive function to convert a character string of digits to.docx
Write a recursive function to convert a character string of digits to.docxdrosa1
 
Write a query to display the customer last name and city for all custo.docx
Write a query to display the customer last name and city for all custo.docxWrite a query to display the customer last name and city for all custo.docx
Write a query to display the customer last name and city for all custo.docxdrosa1
 
write a program that reads package weights and calculate the post fee.docx
write a program that reads package weights and calculate the post fee.docxwrite a program that reads package weights and calculate the post fee.docx
write a program that reads package weights and calculate the post fee.docxdrosa1
 
Write a program that takes an input of n and prints the numbers from 1.docx
Write a program that takes an input of n and prints the numbers from 1.docxWrite a program that takes an input of n and prints the numbers from 1.docx
Write a program that takes an input of n and prints the numbers from 1.docxdrosa1
 
Write a program in assembly language that will test PIN #0 of PORTA to.docx
Write a program in assembly language that will test PIN #0 of PORTA to.docxWrite a program in assembly language that will test PIN #0 of PORTA to.docx
Write a program in assembly language that will test PIN #0 of PORTA to.docxdrosa1
 
Write a program that uses a dynamic array that contains 5 items of dou (1).docx
Write a program that uses a dynamic array that contains 5 items of dou (1).docxWrite a program that uses a dynamic array that contains 5 items of dou (1).docx
Write a program that uses a dynamic array that contains 5 items of dou (1).docxdrosa1
 
Write a program that calculates the final value of a ten year- $10-000 (1).docx
Write a program that calculates the final value of a ten year- $10-000 (1).docxWrite a program that calculates the final value of a ten year- $10-000 (1).docx
Write a program that calculates the final value of a ten year- $10-000 (1).docxdrosa1
 
Write a program that finds the temperature- as an integer - that is th.docx
Write a program that finds the temperature- as an integer - that is th.docxWrite a program that finds the temperature- as an integer - that is th.docx
Write a program that finds the temperature- as an integer - that is th.docxdrosa1
 
Write a python program that opens the career-txt file that is included.docx
Write a python program that opens the career-txt file that is included.docxWrite a python program that opens the career-txt file that is included.docx
Write a python program that opens the career-txt file that is included.docxdrosa1
 
Write a program that contains and utilizes a function called haltNum(i.docx
Write a program that contains and utilizes a function called haltNum(i.docxWrite a program that contains and utilizes a function called haltNum(i.docx
Write a program that contains and utilizes a function called haltNum(i.docxdrosa1
 
Write a program in MATLAB to implement the algorithm of Gaussian Elimi.docx
Write a program in MATLAB to implement the algorithm of Gaussian Elimi.docxWrite a program in MATLAB to implement the algorithm of Gaussian Elimi.docx
Write a program in MATLAB to implement the algorithm of Gaussian Elimi.docxdrosa1
 
write a program to calculate the average of six number input by the us.docx
write a program to calculate the average of six number input by the us.docxwrite a program to calculate the average of six number input by the us.docx
write a program to calculate the average of six number input by the us.docxdrosa1
 
Write a program that uses the DrawingPanel to produces the following f.docx
Write a program that uses the DrawingPanel to produces the following f.docxWrite a program that uses the DrawingPanel to produces the following f.docx
Write a program that uses the DrawingPanel to produces the following f.docxdrosa1
 
Write a program in assembly language 8086 not 8085 to find the number.docx
Write a program in assembly language 8086 not 8085 to find the number.docxWrite a program in assembly language 8086 not 8085 to find the number.docx
Write a program in assembly language 8086 not 8085 to find the number.docxdrosa1
 
write a mips code which pop-ups a confirmation dialog which have yes o.docx
write a mips code which pop-ups a confirmation dialog which have yes o.docxwrite a mips code which pop-ups a confirmation dialog which have yes o.docx
write a mips code which pop-ups a confirmation dialog which have yes o.docxdrosa1
 
Write a program in (C or C++ or Java or python) to capture the center.docx
Write a program in (C or C++ or Java or python) to capture the center.docxWrite a program in (C or C++ or Java or python) to capture the center.docx
Write a program in (C or C++ or Java or python) to capture the center.docxdrosa1
 
write a new equation of the line in slope intercept form parallel to e.docx
write a new equation of the line in slope intercept form parallel to e.docxwrite a new equation of the line in slope intercept form parallel to e.docx
write a new equation of the line in slope intercept form parallel to e.docxdrosa1
 
Write a program file_max-c that reads a set of integer numbers from a.docx
Write a program file_max-c that reads a set of integer numbers from a.docxWrite a program file_max-c that reads a set of integer numbers from a.docx
Write a program file_max-c that reads a set of integer numbers from a.docxdrosa1
 
Write a PHP function (write the function only) to dynamically create a.docx
Write a PHP function (write the function only) to dynamically create a.docxWrite a PHP function (write the function only) to dynamically create a.docx
Write a PHP function (write the function only) to dynamically create a.docxdrosa1
 
Write a PASCAL program to compare two integers entered from the keyboa.docx
Write a PASCAL program to compare two integers entered from the keyboa.docxWrite a PASCAL program to compare two integers entered from the keyboa.docx
Write a PASCAL program to compare two integers entered from the keyboa.docxdrosa1
 

More from drosa1 (20)

Write a recursive function to convert a character string of digits to.docx
Write a recursive function to convert a character string of digits to.docxWrite a recursive function to convert a character string of digits to.docx
Write a recursive function to convert a character string of digits to.docx
 
Write a query to display the customer last name and city for all custo.docx
Write a query to display the customer last name and city for all custo.docxWrite a query to display the customer last name and city for all custo.docx
Write a query to display the customer last name and city for all custo.docx
 
write a program that reads package weights and calculate the post fee.docx
write a program that reads package weights and calculate the post fee.docxwrite a program that reads package weights and calculate the post fee.docx
write a program that reads package weights and calculate the post fee.docx
 
Write a program that takes an input of n and prints the numbers from 1.docx
Write a program that takes an input of n and prints the numbers from 1.docxWrite a program that takes an input of n and prints the numbers from 1.docx
Write a program that takes an input of n and prints the numbers from 1.docx
 
Write a program in assembly language that will test PIN #0 of PORTA to.docx
Write a program in assembly language that will test PIN #0 of PORTA to.docxWrite a program in assembly language that will test PIN #0 of PORTA to.docx
Write a program in assembly language that will test PIN #0 of PORTA to.docx
 
Write a program that uses a dynamic array that contains 5 items of dou (1).docx
Write a program that uses a dynamic array that contains 5 items of dou (1).docxWrite a program that uses a dynamic array that contains 5 items of dou (1).docx
Write a program that uses a dynamic array that contains 5 items of dou (1).docx
 
Write a program that calculates the final value of a ten year- $10-000 (1).docx
Write a program that calculates the final value of a ten year- $10-000 (1).docxWrite a program that calculates the final value of a ten year- $10-000 (1).docx
Write a program that calculates the final value of a ten year- $10-000 (1).docx
 
Write a program that finds the temperature- as an integer - that is th.docx
Write a program that finds the temperature- as an integer - that is th.docxWrite a program that finds the temperature- as an integer - that is th.docx
Write a program that finds the temperature- as an integer - that is th.docx
 
Write a python program that opens the career-txt file that is included.docx
Write a python program that opens the career-txt file that is included.docxWrite a python program that opens the career-txt file that is included.docx
Write a python program that opens the career-txt file that is included.docx
 
Write a program that contains and utilizes a function called haltNum(i.docx
Write a program that contains and utilizes a function called haltNum(i.docxWrite a program that contains and utilizes a function called haltNum(i.docx
Write a program that contains and utilizes a function called haltNum(i.docx
 
Write a program in MATLAB to implement the algorithm of Gaussian Elimi.docx
Write a program in MATLAB to implement the algorithm of Gaussian Elimi.docxWrite a program in MATLAB to implement the algorithm of Gaussian Elimi.docx
Write a program in MATLAB to implement the algorithm of Gaussian Elimi.docx
 
write a program to calculate the average of six number input by the us.docx
write a program to calculate the average of six number input by the us.docxwrite a program to calculate the average of six number input by the us.docx
write a program to calculate the average of six number input by the us.docx
 
Write a program that uses the DrawingPanel to produces the following f.docx
Write a program that uses the DrawingPanel to produces the following f.docxWrite a program that uses the DrawingPanel to produces the following f.docx
Write a program that uses the DrawingPanel to produces the following f.docx
 
Write a program in assembly language 8086 not 8085 to find the number.docx
Write a program in assembly language 8086 not 8085 to find the number.docxWrite a program in assembly language 8086 not 8085 to find the number.docx
Write a program in assembly language 8086 not 8085 to find the number.docx
 
write a mips code which pop-ups a confirmation dialog which have yes o.docx
write a mips code which pop-ups a confirmation dialog which have yes o.docxwrite a mips code which pop-ups a confirmation dialog which have yes o.docx
write a mips code which pop-ups a confirmation dialog which have yes o.docx
 
Write a program in (C or C++ or Java or python) to capture the center.docx
Write a program in (C or C++ or Java or python) to capture the center.docxWrite a program in (C or C++ or Java or python) to capture the center.docx
Write a program in (C or C++ or Java or python) to capture the center.docx
 
write a new equation of the line in slope intercept form parallel to e.docx
write a new equation of the line in slope intercept form parallel to e.docxwrite a new equation of the line in slope intercept form parallel to e.docx
write a new equation of the line in slope intercept form parallel to e.docx
 
Write a program file_max-c that reads a set of integer numbers from a.docx
Write a program file_max-c that reads a set of integer numbers from a.docxWrite a program file_max-c that reads a set of integer numbers from a.docx
Write a program file_max-c that reads a set of integer numbers from a.docx
 
Write a PHP function (write the function only) to dynamically create a.docx
Write a PHP function (write the function only) to dynamically create a.docxWrite a PHP function (write the function only) to dynamically create a.docx
Write a PHP function (write the function only) to dynamically create a.docx
 
Write a PASCAL program to compare two integers entered from the keyboa.docx
Write a PASCAL program to compare two integers entered from the keyboa.docxWrite a PASCAL program to compare two integers entered from the keyboa.docx
Write a PASCAL program to compare two integers entered from the keyboa.docx
 

Recently uploaded

D.pharmacy Pharmacology 4th unit notes.pdf
D.pharmacy Pharmacology 4th unit notes.pdfD.pharmacy Pharmacology 4th unit notes.pdf
D.pharmacy Pharmacology 4th unit notes.pdfSUMIT TIWARI
 
2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptxMaryPotorti1
 
Data Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdfData Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdfChristalin Nelson
 
Appendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxAppendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxRenuka N Sunagad
 
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTScatch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTSCarlaNicolas7
 
Practical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptxPractical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptxKatherine Villaluna
 
skeletal system details with joints and its types
skeletal system details with joints and its typesskeletal system details with joints and its types
skeletal system details with joints and its typesMinaxi patil. CATALLYST
 
Introduction of General Pharmacology PPT.pptx
Introduction of General Pharmacology PPT.pptxIntroduction of General Pharmacology PPT.pptx
Introduction of General Pharmacology PPT.pptxRenuka N Sunagad
 
ACTIVIDAD DE CLASE No 1 - SOPA DE LETRAS
ACTIVIDAD DE CLASE No 1 - SOPA DE LETRASACTIVIDAD DE CLASE No 1 - SOPA DE LETRAS
ACTIVIDAD DE CLASE No 1 - SOPA DE LETRASMaria Lucia Céspedes
 
Exit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docxExit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docxMYDA ANGELICA SUAN
 
Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-PrincipleChromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principleblessipriyanka
 
Unleashing the Power of AI Tools for Enhancing Research, International FDP on...
Unleashing the Power of AI Tools for Enhancing Research, International FDP on...Unleashing the Power of AI Tools for Enhancing Research, International FDP on...
Unleashing the Power of AI Tools for Enhancing Research, International FDP on...Dr. Vinod Kumar Kanvaria
 
Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsIntuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsTushar Tank
 
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxCONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxAnupkumar Sharma
 
2.15.24 The Birmingham Campaign and MLK.pptx
2.15.24 The Birmingham Campaign and MLK.pptx2.15.24 The Birmingham Campaign and MLK.pptx
2.15.24 The Birmingham Campaign and MLK.pptxMaryPotorti1
 
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATIONUNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATIONSayali Powar
 
Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...
Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...
Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...Rabiya Husain
 
Bayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesBayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesTushar Tank
 
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...EduSkills OECD
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUSC_Library
 

Recently uploaded (20)

D.pharmacy Pharmacology 4th unit notes.pdf
D.pharmacy Pharmacology 4th unit notes.pdfD.pharmacy Pharmacology 4th unit notes.pdf
D.pharmacy Pharmacology 4th unit notes.pdf
 
2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx
 
Data Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdfData Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdf
 
Appendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxAppendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptx
 
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTScatch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
 
Practical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptxPractical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptx
 
skeletal system details with joints and its types
skeletal system details with joints and its typesskeletal system details with joints and its types
skeletal system details with joints and its types
 
Introduction of General Pharmacology PPT.pptx
Introduction of General Pharmacology PPT.pptxIntroduction of General Pharmacology PPT.pptx
Introduction of General Pharmacology PPT.pptx
 
ACTIVIDAD DE CLASE No 1 - SOPA DE LETRAS
ACTIVIDAD DE CLASE No 1 - SOPA DE LETRASACTIVIDAD DE CLASE No 1 - SOPA DE LETRAS
ACTIVIDAD DE CLASE No 1 - SOPA DE LETRAS
 
Exit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docxExit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docx
 
Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-PrincipleChromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principle
 
Unleashing the Power of AI Tools for Enhancing Research, International FDP on...
Unleashing the Power of AI Tools for Enhancing Research, International FDP on...Unleashing the Power of AI Tools for Enhancing Research, International FDP on...
Unleashing the Power of AI Tools for Enhancing Research, International FDP on...
 
Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsIntuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov Chains
 
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxCONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
 
2.15.24 The Birmingham Campaign and MLK.pptx
2.15.24 The Birmingham Campaign and MLK.pptx2.15.24 The Birmingham Campaign and MLK.pptx
2.15.24 The Birmingham Campaign and MLK.pptx
 
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATIONUNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
 
Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...
Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...
Barrow Motor Ability Test - TEST, MEASUREMENT AND EVALUATION IN PHYSICAL EDUC...
 
Bayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesBayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with Examples
 
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tour
 

Write a program to compute the volume V of a cylinder of radius r and (1).docx

  • 1. Write a program to compute the volume V of a cylinder of radius r and height h. (Recall that V = r2h.) in c++ let r = 5 and h=12 and pi=3.14 Solution Volume of the cylinder is r 2 h PROGRAM: #include <iostream> #include <cmath> using namespace std; const float pi=3.14; /* defining the constant value of pi and later using it in the program */ int main() { int r=5,h=12; float volume; volume = pi * pow(r,2) * h; /* pow(x,y) is a function used to calculate the value of x y and here it is used to calculate r 2 */ cout<<" Volume of the cylinder is "<<volume; } OUTPUT: Volume of the cylinder is 942