Notification texts go here Contact Us Buy Now!

20 | Data Types

Data Types

Data types determine the type of data associated with variables. Remember the int keyword we used to create integer variables?

// create an integer variable
int age = 25;

Here, int is actually a data type for integer variables. Similarly, there are many other data types in C. For now, we will be looking at the following types:

1. int type - used for integer values without decimal. For example, 4, -43, etc.

2. float type - used for floating-point numbers with decimal. For example, 34.9, 98.2, etc.

3. char type - used for characters. For example, 'g', '(', '-', etc.

Now, to create a variable that stores floating-point numbers and characters, we use the float and char keywords, respectively. For example,

float salary;

char letter;

Idea Emoji Note: We'll learn about the string data type in a later chapter. Right now, we'll only focus on these three data types.

About the Author

Coding | Riding | Music, Embracing the beauty of code, the thrill of the ride, and the rhythm of life. Let's explore the journey together!

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.
Code Copied!