/* The main use of variables is to store some value in it. */ #include<iostream> using std::cout; using std::cin; int main() { int slices=5; /* = symbol is assignment operator, int is data type 5 is value stored in varialbe named "slices" , here we have declared the variable and intialised as well */ int c; //declaration c=7; //intialisation of variable cout<<"you have "<<slices<<" slices of pizza"<<std::endl; //will generate error with cout<<slices<<endl; printf("you have %i slices of pizza \n",slices); // this C function also works in c++, but we have to give format spacifier // thanks to cpp that with cout<< we don't need to provide the format spacifier; cout<<"enter your age"; int age; cin>>age; cout<<"You are "<<age<<" years old"; //cpp is case sensitive example: Slices and SLICES and slices are different variables. }