shlogg · Early preview
Mehfila A Parkkulthil @mehfila123

C++ Variables, Datatypes & User Input Basics

Learn C++ basics! Declare multiple vars with `int x = 15, y = 6, z = 50;` or assign same value in one line `x = y = z = 60;`. Get user input with `cin >> z;` and output with `cout << sum;`.

Please make sure to refer Day3: C++ language | Variables | Datatypes | Part-1


  
  
  Topics to be covered

Variables
Declare multiple Variables
User Input



  
  
  Variables


#include <iostream>
using namespace std;
int main(){
int age = 15;
cout << "my age is:" << age << endl ;
}

    
    

    
    








  
  
  Declare multiple variables

To declare more than one variable of the same type.

#include <iostream>
using namespace std;
int main(){
int x = 15, y = 6, z = 50;
cout << x + y + z;
}

    
    

    
    






You can also assign the same value to multiple variables in one...