Programming Assigment
Programming Assigment
#include<iostream>
using namespace std;
int main() {
double a = 7.481, b, c;
cout << "Enter your Gallons = ";
cin >> b;
c = b / a;
cout << "Gallons Equal to Cub Feet =" << c;
}
Q2.
#include<iostream>
using namespace std;
int main() {
cout << "\t1990 135 " << endl;
cout << "\t1991 7290 " << endl;
cout << "\t1992 11300 " << endl;
cout << "\t1993 16200 ";
}
Q3
#include<iostream>
using namespace std;
int main() {
int temp = 123, a, b, c;
a = temp % 10; // Quotient
cout << "Show the Quotient of 123 and Save A = " << a << endl;
temp = temp / 10; //Reminder
cout << "Show the Reminder of 123 and Save Temp = " << temp << endl;
b = temp % 10; // Quotion
cout << "Show the Quotient of 12 and Save in B = " << b << endl;
c = temp / 10; // Reminder
cout << "Show the Reminder of 12 and Save c = " << c << endl;
cout << a << b << c;
}
Q4
#include <iostream>
using namespace std;
int main()
{
cout << "\tTwinkle, twinkle, little star,\n\tHow I wonder what you are!\n\tUp above the world
so High,\n\tLike a diamond in the sky ";
}
Q5
#include <iostream>
using namespace std;
int main()
{
double p = 1.487, f = 0.172, d = 0.584, y = 0.00955, dollar, pound, franc, deutschemark, yen;
cout << "Enter Your Dollars=";
cin >> dollar;
pound = dollar / p;
cout << "Dollar Convert To Pound = " << pound << endl;
franc = dollar / f;
cout << "Dollar Convert To Franc = " << franc << endl;
deutschemark = dollar / d;
cout << "Dollar Convert To Deutschemark = " << deutschemark << endl;
yen = dollar / y;
cout << "Dollar Convert To Yen = " << yen << endl;
return 0;
}
Q6
#include <iostream>
using namespace std;
int main() {
float celsius, fahrenheit;
cout << "Enter in Celsius = ";
cin >> celsius;
fahrenheit = (celsius * 9 / 5) + 32; // Correct the formula
cout << "Value Of Fahrenheit = " << fahrenheit;
return 0;
}
Q7
#include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, f, g, h;
cout << "Enter the value of a: ";
cin >> a;
cout << "Enter the value of b: ";
cin >> b;
cout << "Enter the value of c: ";
cin >> c;
return 0;’
}
s