C++ examples for Language Basics:Console
Read more than one value in cin statement
#include <iostream> using namespace std; int main()// ww w . java 2s. c om { int num1, num2, num3; double average; cout << "Enter three integer numbers: "; cin >> num1 >> num2 >> num3; average = (num1 + num2 + num3) / 3.0; cout << "The average of the numbers is " << average << endl; return 0; }