Data types

Data type in C programming language

Data type in C programming language

In this tutorial, we will discuss Data type in C programming language

In this topic, we will learn about data type and how to use  in the C programming language.

Typically, data types is an important concept in a programming language such as Java, C++, Python……

It is essential to declare the data type in order to allocate the memory for programming purpose

Each variable is associated with data types and every data type allocates different amounts of memory to perform their specific operations.

 

 

C programming data types

Data types in C language

Primitive data types

int- integer type
  • the int data type is used to declare an integer variable
  • the integer data type is used to store a numeric value
  • integer variable is denoted by int keyword
  • that can have positive, negative and zero values.
  • The storage size of an integer is 2 or 4 or 8 bytes but it depends upon the platform of the system

Integer data type is used to declare  whole number(no decimal value) that can have zero or positive or negative value

Example

0,8,-5

float and double– floating point type
  • float or double variable type is used to store decimal values or real number values.
  • floating point is denoted by float keyword in C
  • The storage size of the floating point is 4  bytes but it depends upon the platform of the system.

float data type is used to declare  decimal numbers(no whole value) that can have positive and negative value

Example

Example

23.34, -5.34

 

char- Character types
  • char variable is used to declare and store character type variables.
  • the character is denoted by char keyword
  • it used to store only one character using the char data type

Example

‘A,’,   ‘c’

 

Void – void data type

Void is a data type(it is also keyword) means No value or nothing. it is mosly used in function identification for not return anythig.

You can not create a variable as void type

 

Derived data type

The derived data type is used for a special purpose, which means, it is grouped of primary data types for a special purpose. These will be discussed clearly later

  • Array
  • Structure
  • union
  • pointer
  • Atomatic type

Catogory of data types

[wp_table id=9821/]

 

Basic Data Types

[wp_table id=9819/]

 

Suggested for you
C operator
Cpp programming variables and types
Python Programming language Data types
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

View Comments

  • I think the admin of this website is truly working hard in favor of his web page, as here every stuff is quality based material.|

Recent Posts

How to find reverse number using method in Java

How to find reverse number using method In this article, we will discuss the concept…

30 minutes ago

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

3 weeks ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

1 month ago

Program to count vowels,consonants,words, characters and space in Java

Program to count vowels, consonants, words, characters and space in Java In this article, we…

1 month ago

How to print multiplication table using Array in C++ language

How to print multiplication table using Array in C++ language In this post, we will…

1 month ago

C Program to multiplication table using Array

C Program to multiplication table using Array In this tutorial , we will discuss about…

2 months ago