C Programming Data Types - learnit

Home Top Ad

Post Top Ad

Saturday, March 20, 2021

C Programming Data Types

C Programming Data Types

C Programming

C++ is a powerful general-purpose programming language. It can be used to develop operating systems, browsers, games, and so on. C++ supports different ways of programming like procedural, object-oriented, functional, and so on. This makes C++ powerful as well as flexible


Why Learn C++?

-C++ is used to develop games, desktop apps, operating systems, browsers, and so on because of its performance.


-After learning C++, it will be much easier to learn other programming languages like Java, Python, etc.


-C++ helps you to understand the internal architecture of a computer, how computer stores and retrieves information.


C Programming Data Types

You will learn about basic data types such as int, float, char etc. in C programming. In C programming, data types are declarations for variables. This determines the type and size of data associated with variables


In the C programming language, data types constitute the semantics and characteristics of storage of data elements. They are expressed in the language syntax in form of declarations for memory locations or variables. Data types also determine the types of operations or methods of processing of data elements.


Example

Int MyWebste

MyWebsite is a Variable of int(integer) Type. The Size of int 4byte.


Basic Types

Here's a table containing commonly used types in C programming for quick access.


Type Size(byte) Format Specifiter
Int at least 2, usually 4 %d, %i
Char 1 %c
Float 4 %f
Double 8 %lf
Short int 2 usually %hd
Unsigned int at least 2, usually 4 %u
Long int at least 4, usually 8 %ld, %li
Long Long int at least 8 %lld, %lli
Unsigned Long int at least 4 %lu
Unsigned Long Long int at least 8 %llu
Singned char 1 %c
UnSingned char 1 %c
Long Double at least 10, usually 12 or 16 %Lf

init

Integers are whole numbers that can have both zero, positive and negative values but no decimal values.


float and double

float and Double are used to hold real numbers.


char

Keyword Char is used for declaring character type variables.


short and long

If you need to use a large number, you can use a type specifier Long


Signed and unsigned

In C, Signed and UnSigned are type modifiers. You can alter the data storage of a data type by using them.


Please Watching My Video is Below

No comments:

Post a Comment

Post Top Ad