C Programming Tutorial 21 - Int, Float, and Double Data Types

  Рет қаралды 146,868

Caleb Curry

Caleb Curry

Күн бұрын

Пікірлер: 55
@codebreakthrough
@codebreakthrough 6 жыл бұрын
notes - calcur.tech/notes-c-programming C Programming Crash Course - www.learn.calebcurry.com/p/c-programming-crash-course Other lessons: Learn Javascript - bit.ly/JavaScriptPlaylist Learn Java - bit.ly/JavaPlaylist Learn C# - bit.ly/CSharpTutorialsPlaylist Learn C++ - bit.ly/CPlusPlusPlaylist Learn C - bit.ly/CTutorialsPlaylist
@marcelbinder2150
@marcelbinder2150 5 жыл бұрын
Huh? We learned that doubles for scanf, for example, need the characters "%d".
@crystalfrappier9750
@crystalfrappier9750 7 жыл бұрын
You have no idea how much your vids are helping me. I'm taking website/creation/design and there's a programming with C class in there. I'm not a fan of it and I can't seem to get it by just reading out of a book. So this is helping big time. Thanks!!!
@sairupesh1344
@sairupesh1344 5 жыл бұрын
wow
@izvarzone
@izvarzone 5 жыл бұрын
I never see anyone use C for webdesign.
@natalieenriquez-birch7960
@natalieenriquez-birch7960 5 жыл бұрын
I thought the format specifier for integer was %d and %lf for double?
@eyyubaydin1370
@eyyubaydin1370 4 жыл бұрын
The short answer is that it has no impact on printf, and denotes use of float or double in scanf. For printf, arguments of type float are promoted to double so both %f and %lf are used for double. For scanf, you should use %f for float and %lf for double. source: stackoverflow.com/questions/25860850/what-is-the-difference-between-f-and-lf-in-c
@mohammedriaz4989
@mohammedriaz4989 4 жыл бұрын
No cap this guy is really good @Caleb Curry i have an interview and i needed to learn the syntax for C bro you've been such a MASSIVE help THANKS also please keep up the amazing work love the vids.
@andrewruttan3318
@andrewruttan3318 6 жыл бұрын
trying to learn C# right now, and had a hard time understanding what these 3 things actually 'do'. thanks for sharing an explanation, helps a lot!
@TheDFitzChannel
@TheDFitzChannel 4 жыл бұрын
Thank you for making it clear, Caleb. This has helped me.
@Pedro-ix8kd
@Pedro-ix8kd 3 жыл бұрын
wow this helps me a lot. I now know what's the difference between the 3. I usually listen to my instructor but can't focus my attention all the way to the end.
@milonsheikh6679
@milonsheikh6679 5 жыл бұрын
Thank you sir , Now I can differ between double and float
@pswr2009
@pswr2009 3 жыл бұрын
Thank you for these videos!! The details you share are filling a lot of gaps in my knowledge.
@takumimusicstore
@takumimusicstore 5 жыл бұрын
I attend school for this and the way they explained it wasnt as detailed and simple as this. Thanks a lot !!
@Ab-ve3vw
@Ab-ve3vw 5 жыл бұрын
You are so amazing,fun learning,like your presentation so much.very interesting not boring !!!!
@Programeris
@Programeris 8 ай бұрын
epic as always ;) 🙌
@lijiaxin5248
@lijiaxin5248 5 жыл бұрын
i thought it’s “%d” for integers?
@sweepingtime
@sweepingtime 5 жыл бұрын
When you use printf %d and %i works the same way.
@mohammedriaz4989
@mohammedriaz4989 4 жыл бұрын
%i
@TheGreatDistracto
@TheGreatDistracto 4 жыл бұрын
#include int main() { //int = integer int = 9; //floating point //precision-how much data the var can hold. printf("%i %f %f ", 1, 1,1111, 1,1111F); return 0; } This that you showed us was in error in all the compilers i used. why if it worked for you?
@estherchan1738
@estherchan1738 3 жыл бұрын
idk if you figured it out (i hope you did!) but it's because you did not name the int. int is just the data type, you need to name int something in order to declare the integer. int integer = 9; //VALID int = 9; //NOT VALID
@TheGreatDistracto
@TheGreatDistracto 3 жыл бұрын
@@estherchan1738 do you mean by /*Declare Int*/ ?
@estherchan1738
@estherchan1738 3 жыл бұрын
@@TheGreatDistracto I ran your code, just two things to fix 1) Naming your int 2) Using decimal points instead of commas I edited your code (and added comments), you can go ahead and play with it. Hope it helps! #include int main() { //int = 9; NOT VALID because no name. /* You need to name the int something, * lets call the integer 'dogs' */ int dogs = 6; //VALID because the int has a name (dogs) /*If you want to print the integer, *you call it by name (dogs) instead of value (6). */ printf("Number of dogs: %i ", dogs); // **Corrected 11111,1111F to 11111.1111F printf("%i %f %f ", 1, 11111.1111, 11111.1111F); return 0; }
@LostOnceLefthanded
@LostOnceLefthanded 3 жыл бұрын
I highly doubt you have a fractional part of a dog as a pet. That's just messed up!" The person who adopted a dog that had lost 2 of his legs and part of his spleen: **cries in the corner**
@aliobeid3953
@aliobeid3953 4 жыл бұрын
Good explanation!!
@qwaysar3721
@qwaysar3721 2 жыл бұрын
thank you this helps me alot
@abdullahbinmamun3803
@abdullahbinmamun3803 6 жыл бұрын
it was so much helpful. thanks a lot.
@francorodriguez1489
@francorodriguez1489 4 жыл бұрын
Thanks, this helped me :)
@WaylandFoster
@WaylandFoster 7 жыл бұрын
I have a general question about the c++ number output system. Currently, I have written a program that is capable of generating a text file for users given certain input from the user in the command console. however, sometimes the numbers generated by the program exceed one million, and thus the program begins to write it as, for example, 1.0064e+006.I understand this means Overflow Error, in a basic understanding, but is there any way to make it output the full number, rather than e+006?
@nonnodacciaio704
@nonnodacciaio704 2 жыл бұрын
Just use a long
@grapejelly7
@grapejelly7 3 жыл бұрын
thx,bro it's helpful
@shahad9624
@shahad9624 7 жыл бұрын
Thank you very much really thank you but how i can make a number smaller as just 2 digits after the point like 12.34 ??
@user-pu8dj9mv9u
@user-pu8dj9mv9u 3 жыл бұрын
My dog has a leg missing. That counts as a fractional dog right?
@keeratkaurguliani1764
@keeratkaurguliani1764 6 жыл бұрын
Could you pls upload a video on enumeration types in C++?
@bryanlomerio2762
@bryanlomerio2762 4 жыл бұрын
thank youuu sirrr🥺
@amantin
@amantin 5 жыл бұрын
5:34 - to an non programmer, thats the absurdiest comment you could make :P (I only see there)
@sar1n120
@sar1n120 3 жыл бұрын
Super helpful :)
@JustThink2000
@JustThink2000 6 ай бұрын
Just as confused as I came into this video. The explanations on float and double are pretty confusing still.
@ayantika3
@ayantika3 4 жыл бұрын
What does return 0 do
@Salamanca-joro
@Salamanca-joro 10 ай бұрын
So as i know float is for number that has fractional point like 25.344 and int is for real numbers like 25 😂 so simple This js my first year studying c and i feel like its fun!
@oniromanxer2231
@oniromanxer2231 5 жыл бұрын
why i am so dumb i could not understand it clearly.double and float are same .but sometime the value is changed by the float data type.but why dude.how will i know that now float will change the value.
@codebreakthrough
@codebreakthrough 5 жыл бұрын
Just don’t use float, ✅
@oniromanxer2231
@oniromanxer2231 5 жыл бұрын
@@codebreakthrough ok thank u dude. You really helped me in my life a lot.
@TheRangeControl
@TheRangeControl 5 жыл бұрын
THANK YOU!!!
@hussainshafiq5880
@hussainshafiq5880 5 жыл бұрын
What happens if we want to print float number in int data type?
@izvarzone
@izvarzone 5 жыл бұрын
i think it would be either floored or give error, depends on language.
@londonsystem6622
@londonsystem6622 4 жыл бұрын
The Best
@ayantika3
@ayantika3 4 жыл бұрын
Before main() I guess it should be void
@giovannialbertosalasatondo3059
@giovannialbertosalasatondo3059 5 жыл бұрын
crap, I have 1/2 of a dog
@neal8317
@neal8317 5 жыл бұрын
hahahahahah
@izvarzone
@izvarzone 5 жыл бұрын
can't be, because amount of dogs is an integer type.
@the_lite_bulb
@the_lite_bulb 3 жыл бұрын
c programming can be funn???!!!! wow
@aga080
@aga080 3 жыл бұрын
this video was not helpful.
@MexicanRoboticsEngineer
@MexicanRoboticsEngineer 4 жыл бұрын
1.1111f
C data types 📊
11:08
Bro Code
Рет қаралды 92 М.
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
Fundamental Data Types − Float, Double & Long Double
13:06
Neso Academy
Рет қаралды 370 М.
C Programming Tutorial 40 - How to Use the Type Cast Operator
7:49
C variables 💰
7:30
Bro Code
Рет қаралды 91 М.
I Helped 2,000 People Walk Again
15:31
MrBeast
Рет қаралды 12 МЛН
C++ Data Types:  Float Vs Double
11:11
Heidi Gentry Kolen
Рет қаралды 22 М.
C++ floating point data types [5]
11:34
Professor Hank Stalica
Рет қаралды 1,8 М.
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 17 МЛН
Know your data type: int - C Programming Tutorial 08
23:03
mycodeschool
Рет қаралды 237 М.
How I program C
2:11:32
Eskil Steenberg
Рет қаралды 796 М.