RAVIANS COLLEGE OF SCIENCE PATTOKI: OOP IN C++ BY Robert lafore 3rd Edition Solution For Exercise 2

OOP IN C++ BY Robert lafore 3rd Edition Solution For Exercise 2

CH2 SOLVED BY WAJID
Q:1. Assuming there are 7.481 gallons in a cubic foot, write a program that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet.

Answer:

#include

void main()
{
float gallons;
float cufeet=7.481;
cout << " Enter gallons: "; cin >> gallons;
cufeet = gallons / 7.481;
cout << "Equivalent in cublic feet is = " << cufeet << endl;
}

No comments:

Post a Comment

Copyright © RAVIANS COLLEGE OF SCIENCE PATTOKI Urang-kurai