C++ examples for Operator:Comma Operator
Put more than one expression on a line, using the comma as a sequence point.
#include <iostream> using namespace std; int main()//w w w . j av a 2s . c o m { int num, sq, cube; num = 5; // Calculate the square and cube of the number. sq = (num * num), cube = (num * num * num); cout << "The square of " << num << " is " << sq << " and the cube is " << cube; return 0; }