Mega Code Archive
Assign value to a variable
#include
using namespace std;
int main()
{
int length; // this declares a variable
length = 7; // this assigns 7 to length
cout << "The length is ";
cout << length; // This displays 7
return 0;
}
The length is 7"