Choose meaningful name for variable - C++ Language Basics

C++ examples for Language Basics:Variable

Description

Choose meaningful name for variable

Demo Code

#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;
}

Result


Related Tutorials