Find the Maximum Number in an Array | C Programming Example

  Рет қаралды 29,373

Portfolio Courses

Portfolio Courses

Күн бұрын

Пікірлер: 18
@logos_42
@logos_42 8 ай бұрын
Thanks again for all your work. I greatly enjoy learning through your practical examples.
@PortfolioCourses
@PortfolioCourses 8 ай бұрын
You're welcome! :-)
@justcurious1940
@justcurious1940 10 ай бұрын
Nice explanation , Thanks : int max_value(int array[],int length){ int max = array[0]; for(int i = 1 ; i < length ; i++){ if(array[i] > max) max = array[i]; } return max; }
@kfiruler1742
@kfiruler1742 7 ай бұрын
one of the best explanation i have ever seen, a BIG THANK YOU sir sir pls make a video on Bits operators coding problems C language
@stavrosv5144
@stavrosv5144 Жыл бұрын
I think that you explained it better than anyone!!! Thank you!!
@PortfolioCourses
@PortfolioCourses Жыл бұрын
You’re welcome Stravos, I’m glad you enjoyed the explanation and thank you for the positive feedback! :-)
@khalil4903
@khalil4903 7 ай бұрын
Hi.., i think when you call a the function find_max you don't need to write it size in the settings.. btw thanks for this amazing video..
@neutral._.7726
@neutral._.7726 Жыл бұрын
I have a question how can we show the count of occurrences of the max number .. for example if we entered 10 twice i want my code to write that the max is repeated twice
@PortfolioCourses
@PortfolioCourses Жыл бұрын
I think you could do something like this. :-) int find_max(int array[], int length) { int max = array[0]; int count = 0; for (int i = 1; i < length; i++) { if (array[i] > max) { max = array[i]; count = 1; } else if (array[i] == max) { count++; } } printf("Count: %d ", count); return max; }
@sarahajjem5671
@sarahajjem5671 9 ай бұрын
but you basically counted the first one as an assumed max , i think you should do minus 1 at the end @@PortfolioCourses
@souzaneto8051
@souzaneto8051 Жыл бұрын
Friend Which IDE are you using. Editor...? Thanks for your attention.
@theemacsen1518
@theemacsen1518 10 ай бұрын
He's using Visual Studio Code as his IDE/Editor and the built-in MacOS terminal to compile his program.
@FrostGamingHype
@FrostGamingHype 2 жыл бұрын
sir im sorry for disturbing but i would like to know if we print anything from the text file in the console window i want to know how can we change the meaning of it example h means q and i means o or u something like this in c++ would really be helpful for my console graphics engine project
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
I don't think I understand the question, do you mean replace characters in a string? There is a video on this here that might be helpful: kzbin.info/www/bejne/ZoDNe5Zjht6Xaqc
@FrostGamingHype
@FrostGamingHype 2 жыл бұрын
​@@PortfolioCourses i meant in an text file if we have written A and user wants to display that as O at the same pos or char 219 an solid block without changing whats written in the file so this can we useful in the game engine im working on please help me :D
@italo_nnn
@italo_nnn 2 жыл бұрын
Perfect!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you! :-D
@Apple-qy3sc
@Apple-qy3sc 9 ай бұрын
for(i=1;i
Count the Occurrences of a Value in an Array | C Programming Example
10:26
Dynamically Allocate An Array Of Structs | C Programming Tutorial
15:11
Portfolio Courses
Рет қаралды 35 М.
Cool Parenting Gadget Against Mosquitos! 🦟👶 #gen
00:21
TheSoul Music Family
Рет қаралды 32 МЛН
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 2,8 МЛН
Find the Minimum Number in an Array | C Programming Example
9:33
Portfolio Courses
Рет қаралды 88 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 254 М.
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,7 МЛН
you will never ask about pointers again after watching this video
8:03
String In Char Array VS. Pointer To String Literal | C Programming Tutorial
9:58
28. C Programming - Max and Min Values in Array
10:20
Antonie Smith
Рет қаралды 42 М.
Dynamic Memory Allocation | C Programming Tutorial
31:51
Portfolio Courses
Рет қаралды 87 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03