C++ examples for Language Basics:Variable
Choose meaningful name for variable
#include <iostream> #include <cmath> using namespace std; int main()//w ww.j av a2 s .c o m { double hydron, pHlevel; cout << "Enter the hydronium ion concentration: "; cin >> hydron; pHlevel = -log10(hydron); cout << "The pH level is " << pHlevel << endl; return 0; }