Calculate the product of three integers - C++ Data Type

C++ examples for Data Type:int

Description

Calculate the product of three integers

Demo Code

#include <iostream>
using namespace std;

int main() {//from   w  w w.  j  av a  2s . c o  m
   int x{0}; // first integer to multiply
   int y{0}; // second integer to multiply
   int z{0}; // third integer to multiply
   int result{0}; // the product of the three integers

   cout << "Enter three integers: "; // prompt user for data
   cin >> x >> y >> z; // read three integers from user
   result = x * y * z; // multiply the three integers; store result
   cout << "The product is " << result << endl; // print result; end line
}

Result


Related Tutorials