Variable in C++ || Datatypes of Variables
×

Variable in C++

3226

A variable can be known as a temporary container for storing information. The programmers are required different methods to store the data; variable provides different methods to work with numbers and value.


Example:

int q=18;
Where, q = variable name

Datatypes of Variable:

Variable have datatypes. On the base of that data types, memory allocations take place by operating system.

Following are the list of datatype present in C++ programming language:

  1. Character types
  2. Integer types (signed)
  3. Integer types (unsigned)
  4. Floating-point types
  5. Void type
  6. Boolean type
  7. Null pointer

Example of C++ Variable Program:

#include <iostream>
using namespace std;
int main()
{
int x= 8;
int y=9;
int result =x*y;
cout<<result;
return 0;
}

Result: 72



Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments