Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Use arithmetic operator to get the product of two integers

#include <iostream>   using namespace std;      int main()   {     int length;    int width;     int area;        length = 7;    width = 5;        area = length * width; // compute area      cout << "The area is ";     cout << area;      return 0;   } The area is 35"