C++ examples for Data Type:double
Double type with declaration and initialization
#include <iostream> using namespace std; int main()//from ww w .java2s . c o m { double grade1 = 85.5; double grade2 = 97.0; double total, average; total = grade1 + grade2; average = total/2.0; // divide the total by 2.0 cout << "The average grade is " << average << endl; return 0; }