C++ Data Types

A data type is the way to specify the type of data that a variable can store such as integer, float, char,etc.

Types of Data types:

Primary Data Types int, char, float, double, etc.
Derived Data Types Array, function, pointer, etc
User Defined Data Types Structure, Class, enum, etc.


Program on Data Types:

#include<iostream.h>
#include<conio.h>
Void main(){
	clrscr();
	int a;
	float  b;
	char c;
        cout<<”Enter a =”;
        cin>>a;
        cout<<”Enter b=”;
        cin>>b;
        cout<<”Enter c=”;
        cin>>c;
        cout<<”a=”<


Output

Enter a=23
Enter b=4.5
Enter c= R

a=23
b=4.5
c=R

Back To Top