Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Create an unsigned short and initialize with result of multiplying Width by Length

#include <iostream> int main() {    using std::cout;    using std::endl;    unsigned short int Width = 5, Length;    Length = 10;    unsigned short int Area  = (Width * Length);    cout << "Width:" << Width << endl;    cout << "Length: "  << Length << endl;    cout << "Area: " << Area << endl;    return 0; }