What is Data Types?
The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. Some of them are an integer, floating point, character, etc. Usually, programming languages specify the range values for given data-type. Each data type requires different amounts of memory and has some specific operations which can be performed over it.
Where we can use Data Types ?
1)Identify the type of a variable when it declared.
2)Identify the type of the return value of a function.
3)Identify the type of a parameter expected by a function.
Types of Data Types :-
1)Primary(Built-in) Data Types: void, int, char, double and float.
2)Derived Data Types: Array, References, and Pointers.
3)User Defined Data Types: Structure, Union, and Enumeration.
we have only see the Built-in Data Types those are int,char,float,double,void
1)char : The most basic data type in C. It stores a single character and requires a single byte of memory in almost all compilers.
2)Int : As the name suggests, an int variable is used to store an integer. it’s only stored whole Numbers.
3)float : It is used to store decimal numbers (numbers with floating point value) with single precision.
4)double : It is used to store decimal numbers (numbers with floating point value) with double precision.
5)void: As the name suggests, it holds no value and is generally used for specifying the type of function or what it returns. If the function has a void type, it means that the function will not return any value. we also seen the which Data Types allocated how many bites in memory when you use those data types.
code for check Data Types allocated bytes:-
Kindly include link File Here
void main()
{
clrscr();
printf("size of int=%d\n",sizeof(int));
printf("size of float=%d\n",sizeof(float));
printf("size of char=%d\n",sizeof(char));
printf("size of double=%d\n",sizeof(double));
getch();
}
C Programming For Beginner PlayList:- • C Programming For Beginner
Introduction to c Programming :- • C Programming For Beginners | 1 | Introduc...
Basic structure of c Program :- • C Programming for Beginner | 2 | Basic Str...
website:-https://elkickofficial.blogspot.com/?m=1
#cprogramming #datatypes #elkick