Defining Variable And Datatypes In C++

Basic concepts of datatypes and varibles in c++

Posted by Zohaib Qazi on may 15, 2017

Defining Variable And Datatypes In C++

After reading this post you will come to understanding the basic datatypes of c++, what are datatypes and variables in c++ .however, clear your concept by reading this post and watching our Balochi videos which is placed below.

Variable

Variable is a name of piece of memory in which information are store.
Example :

x = 1o;
a = 3.5;
c= ‘A’;

Datatypes

C++ deal with programmer a rich variety of built-in as well as user defined data types. Here are some of them are lists down C++ data types:

int

The int means integer which is used for numeric values and its size is 4 bytes

float

The float which is used to represent decimal numbers and its size is 4 byes

double

The double which is used to represent decimal numbers and its size is 8 byes

char

The char means character which is used for single alphabet and its size is 1 byte

bool

The bool stand for Boolean which represents true and false values .

Defining Variable And Datatypes In C++ Video in Balochi

Defining Variable And Datatypes C++ code by balochprgorammer


#include < iostream >
using namespace std;
int main()
{
int a = 2;
float f = 3.5;
char c= 'A';
cout << "Integer Value : "<< a << endl ;
cout << "float Value : "<< f<< endl ;
cout << "char Value : "<< c << endl ;
return 0 ;
}