Offers
Thanks for visiting www.technoexam.com. Stay connected with us for more latest programming updates...

You are here : Home >> Tutorials >> C

Go
Basic C Tutorial

Contents
What is C ?
History
Structure of C Program
Variables & Keywords
Constants
Data Types
Operators
Operators Precedence
Conditional Statements
if Statement
if else Statement
nested if else
switch case
Looping Statements
While loop
Do While loop
For loop
Break
Continue
Goto
Functions
Passing Value
Returning Value
Passing & Returning
Recursion
Storage Class
Array
Structure
Pointer
Union
Strings
Header File
Programs Library
Projects Library
Learn More+

Contact Us

+91-8806583119

Data Types in C

"Data type can be defined as the type of data of variable or constant stored."

When we use a variable in a program then we have to mention the type of data. This can be handled using data type in C.

Followings are the most commonly used data types in C.

Keyword Format Specifier Size Data Range
char %c 1 Byte -128 to +127
unsigned char <-- -- > 8 Bytes 0 to 255
int %d 2 Bytes -32768 to +32767
long int %ld 4 Bytes -231 to +231
unsigned int %u 2 Bytes 0 to 65535
float %f 4 Bytes -3.4e38 to +3.4e38
double %lf 8 Bytes -1.7e38 to +1.7e38
long double %Lf 12-16 Bytes -3.4e38 to +3.4e38

Qualifier :

When qualifier is applied to the data type then it changes its size.

Size qualifiers : short, long

Sign qualifiers : signed, unsigned


Enum Data Type :

This is an user defined data type having finite set of enumeration constants. The keyword 'enum' is used to create enumerated data type.

Syntax:

enum [data_type] {const1, const2, ...., const n};

Example:

enum mca(software, web, seo);


Typedef :

It is used to create new data type. But it is commonly used to change existing data type with another name.

Syntax:

typedef [data_type] synonym;

OR

typedef [data_type] new_data_type;

Example:

typedef int integer;
integer rno;

Download PDF
Published on: 12th Nov 2010, Last Updated on: 18th Dec 2014

Mr. Dinesh Kudache
AUTHOR: Mr. Dinesh Kudache

Mr. Dinesh is the Founder and CEO of technoexam.com. He had 6+ years experience in Application Programming, System Programming, Web Design and Development, Google Expertise. He had written 5000+ various articles on programming. Browse more articles by this author.

Link this post on your Blog/Website :