Basic data type in C for people in a hurry.
“I like C because it avoids class warfare.” — Elon Musk.
If you think coding and programming is not your cup of tea, then let me tell you, it’s actually straightforward.
Let me explain ‘C' to you. It’s a programming language. Well, let me explain what that is.
Data types in c:
Data type specifies how we enter data into our program and what type of data we enter.
Now that’s the mainstream corporate definition. If you don’t know what coding or programming is, then let me tell you that essentially you’re just filling up certain codes into your pc or laptop and getting things done. You’re just telling the computer to perform like you want it to do. If you want to build a website? No issues, we’ve got codes which help you with it. Where should the text be placed? Where the title goes? No worries, we’ve got programs for it too. So programming is all about writing and typing various inputs to get things done.
Now back to the topic, data types in c.
Types of Data types:
- Basic data type ( int, char, float, double)
- Derived data type (array, pointer, structure)
- Enumeration data type (enum)
- Void data type (void)
Don’t worry about the int, char, and everything right now. We’ll discuss each of them in detail. Let’s begin,
What’s int?
Well, int is just a short form for integer. Integers are just a series of numbers falling between negative infinity to positive infinity, including zero.
Example: …..-1,0,2…..
What’s char?
Just as int stores integers, char only cares about characters or letters.
Want to deal with alphabets? Then we have to use char.
What’s float?
It’s a shortened term for floating-point. Using float, we can declare any decimal values.
E.g., 3.14? That’s π. It’s a decimal value, so we can’t declare it int as int is concerned only about whole numbers. Not fractions.
This takes us to our first important point:
Int doesn’t declare fractions. We use float to declare decimal places and fractions.
What’s double?
A fundamental data type built into the compiler and used to define numeric variable holding number with a decimal point.
So that’s pretty much it when it comes to the basic data types in c.
Stay scientific, stay protected.
This is Aryan Panchal signing off.
Code TECHNIQ offers its unique, one-of-a-kind counseling session. If our content helps you, please consider subscribing to our Newsletter. You are welcome to one of our many career events.
Code TECHNIQ’s founders came across the idea to launch an alternative to learn programming after trying to find one.
Finding none suiting their parameters, they started Code TECHNIQ as a credible option that would bridge the gap between the convivence & affordability of a Massive Open Online Course (MOOC) & the quality benchmarking of a typical boot camp.
Ensuring students have the option to learn skills suiting their personas and goals while staying out of debt.