MeraForum Community.No 1 Pakistani Forum Community

MeraForum Community.No 1 Pakistani Forum Community (http://www.MeraForum.Com/index.php)
-   C++ (http://www.MeraForum.Com/forumdisplay.php?f=216)
-   -   Primitive Data Types In C++ (http://www.MeraForum.Com/showthread.php?t=112993)

Morash 04-04-2014 02:54 PM

Primitive Data Types In C++
 



Primitive Data Types In C++



The primitive data types in C++ language are the inbuilt data types provided by the C++ language itself. Thus, all C++ compilers provide support for these data types.
The following primitive data types in C++ are available:



Integer data type is used to declare a variable that can store numbers without a decimal. The keyword used to declare a variable of integer type is “int”.

Syntax:
int variable_name;




Float data type declares a variable that can store numbers containing a decimal number. The keyword used to declare a variable of float type is “float”.

Syntax:
float variable_name;




Double data type also declares variable that can store floating point numbers but gives precision double than that provided by float data type. Thus, double data type are also referred to as double precision data type. The keyword used to declare a variable of double type is “double”.

Syntax:
double variable_name;




Character data type declares a variable that can store a character constant. Thus, the variables declared as char data type can only store one single character. The keyword used to declare a variable of character type is “char”.

Syntax:
char variable_name;




Unlike other primitive data types in C++, void data type does not create any variable but returns an empty set of values. Thus, we can say that it stores null.

Syntax:
void variable_name;



Princess Urwa 04-04-2014 03:28 PM

Re: Primitive Data Types In C++
 
thanx for sharing

AYAZ 04-04-2014 04:06 PM

Re: Primitive Data Types In C++
 
Thanks, baki sab tou samj agaye bas yeh void ka samj nahi aya yeh kia karta hie

PRINCE SHAAN 04-04-2014 07:51 PM

Re: Primitive Data Types In C++
 
Thanks for nice sharing...................

pakeeza 04-04-2014 08:27 PM

Re: Primitive Data Types In C++
 
Thnks for SharinG

Morash 04-07-2014 02:05 AM

Re: Primitive Data Types In C++
 
Thanks All ..


All times are GMT +5. The time now is 04:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.