首页 编程C/C++演示变量的用法

演示变量的用法

#include <iostream>
//Demostration of variables
using std::cout;
using std::endl;
int main()
{
 unsigned short int width = 5 , length;
 length = 10;
//Create an unsigned short and initialize with result
//of multiplying width by length
 unsigned short Area = (width * length);
 cout << “width:” << width << endl;
 cout << “length:” << length <<endl;
 cout << “Area:” << Area << endl;
 return 0;
}