Count The Digits In An Integer Using Recursion | C++ Example

  Рет қаралды 2,062

Portfolio Courses

Portfolio Courses

Күн бұрын

Пікірлер
@leythecg
@leythecg Жыл бұрын
for me one of the best channels on u Tube in terms of C programming! Thanks a lot!
@PortfolioCourses
@PortfolioCourses Жыл бұрын
You're very welcome, I'm glad you're enjoying the channel! :-D
@octophrator1248
@octophrator1248 Жыл бұрын
Alternatively, count_digits could also be like this, if you don't want to use recursion: int count_digits(int number) { int p; for (p = 0; pow(10, p)
@PortfolioCourses
@PortfolioCourses Жыл бұрын
Thank you for sharing this! :-)
@karimbousmaha4038
@karimbousmaha4038 4 ай бұрын
Plz share a Playlist about making some games with graphics in c++
@bresent
@bresent Жыл бұрын
Can you make a playlist for graphics ? Like SDL or Raylib using C
@PortfolioCourses
@PortfolioCourses Жыл бұрын
Raylib is something I've had a few people request, it's something I've looked into a bit now. :-)
@MadpolygonDEV
@MadpolygonDEV Жыл бұрын
I think its cleaner to do this as recursion takes a while to read for me int count=0; While (number) { count++; number/=10; } return count;
@PortfolioCourses
@PortfolioCourses Жыл бұрын
I think so too. :-) Most of the time it's better to do things "iteratively" with a loop, rather than recursively. I make videos solving recursion problems because lots of teachers assign these to students to help them understand recursion, and the goal with the video is to help out the students that are struggling or stuck.
@MadpolygonDEV
@MadpolygonDEV Жыл бұрын
@@PortfolioCourses i see, your videos are amazing, thanks for all the content!!
@PortfolioCourses
@PortfolioCourses Жыл бұрын
You're welcome! :-)
@jcamargo2005
@jcamargo2005 Жыл бұрын
While this is a great example on C, it is good to know that you can get this done with a single instruction in x86 architecture (LZCNT)
@PortfolioCourses
@PortfolioCourses Жыл бұрын
Thanks for sharing that! :-)
Count The Vowels In A String Using Recursion | C Programming Example
10:24
Portfolio Courses
Рет қаралды 2,7 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 336 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Sum Of Digits Of A Number Using Recursion | C++ Example
8:25
Portfolio Courses
Рет қаралды 4,9 М.
Generating Fibonacci Series using Recursion: C Program
14:45
Technotip
Рет қаралды 10 М.
Animation vs. Math
14:03
Alan Becker
Рет қаралды 78 МЛН
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 843 М.
Recursion for Beginners - Fibonacci Numbers
10:16
NeetCode
Рет қаралды 25 М.
Why algorithms are called algorithms | BBC Ideas
3:09
BBC Ideas
Рет қаралды 3 МЛН
Calculate String Length Using Recursion | C Programming Example
7:55
Portfolio Courses
Рет қаралды 5 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
What is mathematical thinking actually like?
9:44
Benjamin Keep, PhD, JD
Рет қаралды 27 М.