0% found this document useful (0 votes)
10 views1 page

Example Questions For C++

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Example Questions For C++

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

SR UNIVERSITY

SCHOOL OF ENGINEERING

Course-B.Tech Type-Programming Elective


Course Code-24CS203ES103 Course Name-Problem Solving using C++
Year-2024-2025 Semester-Even
Date Batch– ME & CE Batches

Week 9.2
Topics: Functions

Questions:

A. Write a C++ program that defines a function to compute the efficiency of a heat engine, given
the heat input and work output.

η=(Heat Input/Work Output)×100

Sample Input/Output

Enter heat input (in J): 2000


Enter work output (in J): 800
Efficiency: 40%
B. Write a C++ program that defines a function to calculate torque when force and radius are
given.

T=Force × Radius

Sample Input/Output:

Enter force (in N): 50


Enter radius (in m): 0.5
Torque: 25 Nm
C. Write a C++ program that defines a function to compute the power transmitted by a rotating
shaft, given torque and speed (RPM).

P= (2π×Torque×RPM)/ 60

Sample Input/ Output:

Enter torque (in Nm): 10


Enter speed (in RPM): 1200
Power: 1256.64 W

You might also like