Calculate the product of three integers - C++ Operator

C++ examples for Operator:Arithmetic Operator

Description

Calculate the product of three integers

Demo Code

#include <iostream>
using namespace std; 

 
int main() //from   w  ww .jav a2  s  .  c  o  m
{ 
    int x; // first integer to multiply 
    int y; // second integer to multiply 
    int z; // third integer to multiply 
    int result; // 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 
    
    return 0;
}

Result


Related Tutorials