#19 C Arrays | C Programming For Beginners

  Рет қаралды 297,494

Programiz

Programiz

Күн бұрын

Пікірлер: 360
@programizstudios
@programizstudios 2 жыл бұрын
🚀 Loved the tutorial? Take it further with Programiz PRO! Refine your skills, conquer coding fears, and build confidence with interactive lessons, quizzes, and challenges. Strengthen your programming foundation and master C today! 👉Start Here: bit.ly/c-master
@AbhiramDeshpande-fe1vi
@AbhiramDeshpande-fe1vi Жыл бұрын
#include int main() { int marks[5]={50,66,78,84,92}; int average = (marks[0]+marks[1]+marks[2]+marks[3]+marks[4])/5; printf(" the average marks is : %d",average); return 0; }
@shondeabreu5542
@shondeabreu5542 Жыл бұрын
@@AbhiramDeshpande-fe1vi I made mine a bit more complex lol.
@ShyamSai-tz9bt
@ShyamSai-tz9bt Ай бұрын
Please explain about * pattern
@stealthy_doctor
@stealthy_doctor 7 ай бұрын
wonderful explanation, i think the answer to the quiz is C. 0 and for the task: #include #include int main() { // Write C code here int age[6]; int sum; int average; printf("Enter 5 Subject's Grades: "); for(int i =0;i
@softwareupdater99
@softwareupdater99 Ай бұрын
No a cell or slot in memory can never be empty there may be a junk value
@hrushikeshtodkari5265
@hrushikeshtodkari5265 2 жыл бұрын
I Like your teaching method. keep posting such contents free for the student. thank you.....
@SauravKumar-vj7ks
@SauravKumar-vj7ks 2 жыл бұрын
Awesome and crisp explanation. Keep making more videos to cover the entire language. Your series is really very crisp ,informational and easily understandable.
@joechen9498
@joechen9498 5 ай бұрын
#include int main() { int marks[5]={12,13,14,15,16}; int sum = marks[0]+marks[1]+marks[2]+marks[3]+marks[4]; printf("%d" ,sum); int average = sum/5; printf("%d" , average); return 0; }
@yahyaelgandouer3591
@yahyaelgandouer3591 3 ай бұрын
Do the sum in a loop
@Salamanca-joro
@Salamanca-joro 2 ай бұрын
​@@yahyaelgandouer3591 I did it like he did it at first but after your comment this is my new code : #include Int main () { Double grade[5] = { 75.55 , 55.55 , 99.55 , 67.65 , 32.22 } Double sum = 0; for ( int i = 0 ; i < 5 ; i++ ) { Sum = sum + grade[i] ; } Double average = sum / 5 ; Printf(" the average grade for the student is %.2f " , sum ) Return 0 ; }
@johnlouiesingculan-tw3gx
@johnlouiesingculan-tw3gx Ай бұрын
bogoas giatay oy
@olusamuel7672
@olusamuel7672 Жыл бұрын
The Quiz answer is 0, no digit is stored in that index so automatically it's 0. Between I love the way you teach, you make C look easy and have really really learnt a lot from your channel. good job ❤😊
@JoseCarv0
@JoseCarv0 9 ай бұрын
Yes, it is 0, but the reason is not that.
@galaxygaming8109
@galaxygaming8109 6 ай бұрын
sok tau kau deck
@KeiraJanineMatulac
@KeiraJanineMatulac Ай бұрын
@@JoseCarv0 then what?
@ashenafigodana
@ashenafigodana Жыл бұрын
clear, concise and to the point explanation Thank you.
@murti1565
@murti1565 2 жыл бұрын
i love it when she says "jero"
@ravikumarronad7475
@ravikumarronad7475 2 жыл бұрын
Correct Answer is C. 0 Array of size is 5 so in the given array have 3 elements so remaining 4th and 5th index number store automatically 0 value. Pictorial is: Int num[5]= { 2, 3, 5, 0, 0} Important Note: Array is Collection of Homogenous elements.
@akashmathdevru8618
@akashmathdevru8618 Жыл бұрын
no it show random no....because in video saw put value 6 nut it can present 0--4 integer remaining it get random no. so i think D
@TiTan-gr3pv
@TiTan-gr3pv Жыл бұрын
​@@akashmathdevru8618in that case the value she asked for was out of the size of the array so it gave a random value but if you don't store any value willingly inside a particular index of an array the value 0 will be stored in many compilers and some may show an error so it doesn't give an output of a random value
@zindycangaming9851
@zindycangaming9851 Ай бұрын
@@akashmathdevru8618 0 comes when u acess a element that does not exist, random value comes when you access a array index grater than the maximum lenght specified when declared.
@danielmalatji1813
@danielmalatji1813 Жыл бұрын
am yet to find best teacher thank you for your content it really makes it easier to learn and grasp info on c programming.
@novafenice5745
@novafenice5745 2 жыл бұрын
#include #include int main(){ float grades[5]; int i; float sum = 0; for(i = 0; i < 5; i++){ printf("Inserect grades: "); scanf("%f", &grades[i]); sum = sum + grades[i]; } float average = sum/5; printf("The average marks is: %.2f", average); return 0; }
@nyangparker4195
@nyangparker4195 7 ай бұрын
woah! you are great in explaining c programming. sorry my English is not that good, but yours was good enough to make me understand it very well. thankyou! i hope to see more videos from you!
@NoumanAhmedMomin
@NoumanAhmedMomin 2 ай бұрын
very easy to understand and is quite informative with good teaching!!!!!🙂🙂🙂😀😀😀
@linbz2784
@linbz2784 7 ай бұрын
this is helping me a lot, i always use programiz terminal when i want to try something quick and it is really helpful. Now those classes are helping me understand even more.
@saladevamanikanta6788
@saladevamanikanta6788 2 жыл бұрын
mam! i did it, lots of thanks for you by adding the addition points to it. Thanks a lot mam. /* Create a program that computes the average marks of a student. 1. Create an array that stores the marks of n subjects. 2. Compute the total marks by adding all the marks. 3. Divide the total marks by total number of subjects. 4. Compute the percentage. 5. Print the average marks and percentage and total marks. */ #include #include int main() { int subs, subs1, total_marks = 0, array[100], entire_total; float average, percentage; clrscr(); printf("Enter how many subjects you have: "); scanf("%d", &subs); printf("The Entire Total marks of the subjects are: "); scanf("%d",&entire_total); for(subs1 = 0; subs1 < subs; subs1++) { printf("Enter the score in subject%d : ", subs1); scanf("%d", &array[subs1]); } for(subs1 = 0; subs1 < subs; subs1++) { total_marks = total_marks + array[subs1]; } average = (float)total_marks / subs; percentage = ((float)total_marks / entire_total ) * 100; printf(" The Total marks of the subjects out of %d : %d", entire_total,total_marks); printf(" The Average marks of the subjects are: %.3f", average); printf(" The Percentage of all subjects according to your marks: %.3lf %", percentage); getch(); return 0; }
@BasavarajBiradar-x2d
@BasavarajBiradar-x2d 24 күн бұрын
Nice explanation mam❤
@2snish
@2snish 2 жыл бұрын
Thank you ! Great explanation,Simple but precise and also great initiative on making this videos available to all !
@SumitSingh-ov6ws
@SumitSingh-ov6ws 2 жыл бұрын
Programming task: /*Create a program that computes the average marks of a student. Create and array that stores the marks of 5 subjects; Compute the total marks by adding all the marks; Divide the total marks by the total number of subjects; Print the average marks. */ #include main() { int i; int sum=0; int marks[5]; for(i=0;i
@bansarithakker7661
@bansarithakker7661 Жыл бұрын
Thnx broo
@ntwadumela7
@ntwadumela7 Жыл бұрын
Good but its good programming practice that you initialize avg as int avg and then add avg=sum/5 and print it.
@andrewsterling895
@andrewsterling895 Жыл бұрын
I suggest you remove the printf("Entre the marks "); out of the for loop.
@josuealcala6255
@josuealcala6255 8 ай бұрын
I appreciate this. I missunderstood the wording of the quiz and this made me understand what she was asking for
@Sagar_Nath629
@Sagar_Nath629 2 ай бұрын
Thanks mam! It really helped me and I love to use this C compiler
@Honest_Reply900
@Honest_Reply900 8 ай бұрын
One of the best teaching method, please go ahead and make more contents like this
@naomywitherwhy129
@naomywitherwhy129 Жыл бұрын
in the for loop you had an input of 16 but printed out as 6 in the compiler, what could be the problem
@swapnildargude284
@swapnildargude284 2 жыл бұрын
#include int main() { int marks[5]; int i,sum=0,average; printf("Enter marks of 5 subjects"); for (i = 0; i
@pashamreddy7926
@pashamreddy7926 2 жыл бұрын
at 11.30 why did the output come as 6 instead of 16 ?
@ElHipokondriako
@ElHipokondriako Жыл бұрын
I did notice too. Just guessing, but might be a bug in the compiler?
@Saint-Phillemon
@Saint-Phillemon 6 ай бұрын
I love her english, so different and unique to grasp even better
@dryadsharaz
@dryadsharaz 7 ай бұрын
Haa nhasi ndopandatozonzwisisa ma array after a long time. Well done parohwa basa apa🙌🤝
@zindycangaming9851
@zindycangaming9851 Ай бұрын
You are a representation for "Education must be free"
@mek059
@mek059 2 жыл бұрын
At 11:30 it printed 6 instead of 16 .. Why? 😳
@roxettesamarinta9801
@roxettesamarinta9801 2 жыл бұрын
Same question too
@ElHipokondriako
@ElHipokondriako Жыл бұрын
Does the same at 12:09. I think it's just a bug in the compiler.
@teddymacdesley
@teddymacdesley 6 ай бұрын
Thabks alot this woll surely hwlp me for today HND exams i have .
@mohammadabdullahaalforhad1375
@mohammadabdullahaalforhad1375 Жыл бұрын
your understanding is so good
@bullshit485
@bullshit485 Ай бұрын
The answer is C, 0. Since the Array has been assigned 5 , and only three integers from 0 to 2 have been filled in. Therefore, 3 and 4 will be filled in with 0's.
@97pjh39
@97pjh39 Ай бұрын
How about in the for loop example? Why did age[5] printed random values instead of 0?
@yutadagoat-p7b
@yutadagoat-p7b 2 жыл бұрын
#include int main() { int subjmarks[5]; printf("enter marks of 5subjects: "); for(int s=0;s
@sanayounas8014
@sanayounas8014 2 жыл бұрын
I Like your teaching method. keep posting such contents free for the student. Thank you answer is 0
@saiphanikrishnathallam5599
@saiphanikrishnathallam5599 Жыл бұрын
Great and simply explained too good And the answer is( c) . 0
@war.blitzee7985
@war.blitzee7985 2 жыл бұрын
Thank you very much for these videos. Your websites also give excellent content. Keep up the great work.
@francismally2468
@francismally2468 Ай бұрын
Iperhaps one of the greatest teaching on c language fundamentals in India from my experience with teachers
@ashmitashrestha9317
@ashmitashrestha9317 Ай бұрын
From Nepal*
@hrushikeshtodkari5265
@hrushikeshtodkari5265 2 жыл бұрын
D. Random value
@dhanushs1802
@dhanushs1802 2 жыл бұрын
I guess you haven't considered the size of the array, so it is 0.
@programizstudios
@programizstudios 2 жыл бұрын
[Programiz Video Quiz] Q. Which value will we get when we print num[4] from the following array? int num[5] = {2, 3, 5}; 1. 2 2. 5 3. 0 4. Random Value
@thisistusharmahajan
@thisistusharmahajan 2 жыл бұрын
0
@Maybemiles_C
@Maybemiles_C 2 жыл бұрын
Answer:- 0
@user-gv9if4jx3h
@user-gv9if4jx3h 2 жыл бұрын
Garbage Value
@rickzalman4136
@rickzalman4136 2 жыл бұрын
0 is the default value for any element not initialized by the user
@codewithabhi1089
@codewithabhi1089 2 жыл бұрын
0 will be the answer bcz size is exceeding the array.
@Codingwithmudasir
@Codingwithmudasir 17 күн бұрын
Good Video
@anesp.a913
@anesp.a913 2 жыл бұрын
The output of that code is option (d) Random Value
@maxwell4466
@maxwell4466 Жыл бұрын
That's what I thought, apparently their github repository says different.
@iam__aj37
@iam__aj37 Жыл бұрын
@@maxwell4466 Can you provide me their gitHub repository link?
@ElHipokondriako
@ElHipokondriako Жыл бұрын
11:27 somehow returned "6" instead of "16" in age[3]?
@zombiesbyte331
@zombiesbyte331 Жыл бұрын
I'm also puzzled by this
@shadyzmartinez
@shadyzmartinez 9 ай бұрын
i found it interesting 😊 i like it
@MupenziJeanFelix-wk9rx
@MupenziJeanFelix-wk9rx Жыл бұрын
hello. I like however you teach or share us about your skills. thank you alot.
@dexterstudytool
@dexterstudytool 6 ай бұрын
nice class and this are best in business
@parkwanff1743
@parkwanff1743 6 ай бұрын
int main(){ int n; printf("Enter the number of subjects "); scanf("%d",&n); float a[n]; float sum=0.0; float average; for(int i=0;i
@jessamiee88
@jessamiee88 2 жыл бұрын
thank you very very very much, you help me a lot
@expecttheunexpectedt
@expecttheunexpectedt 2 жыл бұрын
Excellent to understanding... Tqsm mam...
@ItsAndroidDeveloper
@ItsAndroidDeveloper Жыл бұрын
I love programmiz😊😊😊 5:11
@ananyatak5121
@ananyatak5121 Жыл бұрын
programming task- int marks[5]; printf(" Enter the marks of 5 different subjects of a student:"); for (int i=0; i
@lonehesh8933
@lonehesh8933 2 жыл бұрын
#include int main() { float mark [5]; float sum=0; float acumulador = 0,average=0; printf("Enter subject marks: "); for (int i = 0 ; i < 5; ++i) { scanf("%f", &mark[i]); sum=sum+mark[i]; acumulador =acumulador+mark[i]; } printf("sum is %f ",sum); printf("average is %f ",acumulador/5); }
@muzahidul1234
@muzahidul1234 Ай бұрын
Thank you so much ❤
@fairooznadia8955
@fairooznadia8955 Жыл бұрын
#include int main() { int i; double avg; double marks[5]; printf("Enter marks of 5 subjects:"); for(i=0 ;i
@jagdishshinde4383
@jagdishshinde4383 2 жыл бұрын
Assomone explanation mam👍👍👍👍
@tripodshedbymuyengwa7014
@tripodshedbymuyengwa7014 2 жыл бұрын
int main() { int ave,sum; int student_marks[5]; printf("Enter student marks :",student_marks[5]); scanf("%d%d%d%d%d",&student_marks[5]); { sum=student_marks[5]++; printf("Total mark is : ",sum); } ave=sum/5; printf("Avarage mark is:%d",ave); return 0; }
@dreadwing1784
@dreadwing1784 2 ай бұрын
Nice explanation than college! 💪🛡️
@umarsquare4328
@umarsquare4328 Жыл бұрын
I really like your explanation.....
@keshavdixit08
@keshavdixit08 2 жыл бұрын
#include int main() { int marks_sub[5] = {60,70,54,82,50}; float total_marks=0, avg_marks; //total_marks = marks_sub[0] + for (int i=0;i
@NCW06
@NCW06 3 ай бұрын
it will return 0,because we created 5 element array with 5 index value 0-4 we not assign any value to index 3 and index 4 so it will return null value which will be zero
@Sara.j-hk4my
@Sara.j-hk4my Жыл бұрын
#include int main( ) { int marks[5], i; int sum=0; float avg; for(i=0;i
@arjunsavitha466
@arjunsavitha466 2 жыл бұрын
Thank you mam 😊
@joshuavanniekerk884
@joshuavanniekerk884 4 ай бұрын
This is the best videos!
@bullgamerdoga9293
@bullgamerdoga9293 Жыл бұрын
best channel ever thank you hanım abla
@DhoniMama-kj5ur
@DhoniMama-kj5ur 2 ай бұрын
8:41 you can automatically by keyboard na why are u using age[2]?
@batuhanerkek2874
@batuhanerkek2874 2 жыл бұрын
Arrays is very easy with you.
@SilicioouGrafeno
@SilicioouGrafeno 6 ай бұрын
When changing the value of the array age[2] from 25 to 26, why wasn't it changed directly inside the int function? 8: 48 is the video time. Someone please help me understand this.
@nihatdonmzov4166
@nihatdonmzov4166 2 жыл бұрын
Thank you so much for the video !
@pravyjha4567
@pravyjha4567 7 ай бұрын
At 11:25 why u used ++i instead of i++
@shivaprasad._.08
@shivaprasad._.08 Жыл бұрын
Superb explanation 🙏
@Saurabhekka22
@Saurabhekka22 Жыл бұрын
I might be wrong but the answer to the question in the end is Random value, option (D)
@pravinsingh3453
@pravinsingh3453 2 жыл бұрын
Thank you mam give more things of array,🥰🥰
@AhmadAlMassry-d2t
@AhmadAlMassry-d2t Жыл бұрын
double number[5]; printf("Enter the number: "); scanf("%lf %lf %lf %lf %lf", &number[0],&number[1],&number[2],&number[3],&number[4]); double add = (number[0]+number[1]+number[2]+number[3]+number[4]); double sum = add / 5; printf("%lf", sum);
@BWM.LIFE-FOUNDATION-tv
@BWM.LIFE-FOUNDATION-tv Жыл бұрын
Nice my teacher 🙏🙏🎉🎉
@AM-yd8en
@AM-yd8en Жыл бұрын
11:28 shouldn’t printf be in scanf’s place and vice versea?
@jeditayy6365
@jeditayy6365 9 ай бұрын
No
@bibeklimbu-nt4ff
@bibeklimbu-nt4ff 8 ай бұрын
guyz haru ta nepali po raixan so proud of that
@prajwal_bagewadi
@prajwal_bagewadi 2 жыл бұрын
very nice video 😊😊😊❤❤❤🙏mam
@jdram82
@jdram82 2 жыл бұрын
Great Explanation, Thank you for the same.
@ordealkarisa1517
@ordealkarisa1517 2 жыл бұрын
Wow I like the way you pronounce zero. You're the best 👌 ever 💓
@bandulajagathkumara1038
@bandulajagathkumara1038 2 жыл бұрын
I love her accent ❤️☺️
@AM-yd8en
@AM-yd8en Жыл бұрын
8:48 why the output is not 25, and what if i want 25 what should i do?
@abhijeettechverse7
@abhijeettechverse7 2 жыл бұрын
Ans is - D. Random value because we are trying to access uninitialized value
@RailExpressbyPreetam
@RailExpressbyPreetam Жыл бұрын
Nice explanation mam
@davebull6321
@davebull6321 Жыл бұрын
int marks[5]; printf("Write down the 5 numbers: "); for(int i= 0;i < 5; ++i) { scanf("%d", &marks[i]); } int avg = ((marks[0] + marks[1] + marks[2] + marks[3] + marks[4]) /5 ) ; printf("Result = %d",avg); return 0; }
@Kenara_Music
@Kenara_Music Жыл бұрын
Happy programming 🎉
@AM-yd8en
@AM-yd8en Жыл бұрын
13:09 the answer is 0 right?
@kavinkumarg691
@kavinkumarg691 2 жыл бұрын
ANSWER #include int main() { int i; int marks[5]; int total=0; printf("enter the marks: "); for(i=0;i
@user-mr3mf8lo7y
@user-mr3mf8lo7y Жыл бұрын
Thanks a bunch.
@marusukech.5049
@marusukech.5049 2 жыл бұрын
programming task: #include int aver(int total){ int average = total / 5; return average; } int main(){ int subjects[5]; printf("Enter the marks:"); for(int i = 0;i < 5;++i){ scanf("%d", &subjects[i]); } int total; for(int i = 0;i < 5;++i){ total = total + subjects[i]; } int average = aver(total); printf(" Average marks: %d", average); return 0; }
@Jeff-qr8eo
@Jeff-qr8eo 6 ай бұрын
I understand this more than from my class lol.
@vishnureddy6098
@vishnureddy6098 Жыл бұрын
May I know where we can use new line character "/n"
@lynne.5416
@lynne.5416 2 жыл бұрын
#include int main() { int i, marks[5]; for(i=0; i
@ebukaokereke8341
@ebukaokereke8341 Жыл бұрын
Do a video of array using DEV C++
@therealstruggle
@therealstruggle Жыл бұрын
i dont get it in the last part of hte video u ask one quesetion it ans will be random number
@jackyjaii2154
@jackyjaii2154 Жыл бұрын
#include int main() { int mark[5]; printf("Enter marks of 5 subject: "); int sum = 0; for(int i = 0; i < 5; ++i) { scanf("%d", &mark[i]); sum = sum + mark[i]; } int averageMarks = sum/5; printf("average marks is %d", averageMarks); return 0; }
@chidozie.o
@chidozie.o 8 ай бұрын
so good👌
@amenabegumakhi4521
@amenabegumakhi4521 2 ай бұрын
thanks sis
@yousefkhaled6082
@yousefkhaled6082 5 ай бұрын
int main() { int marks[5],sum,avg,x; printf("Please enter the grades of 5 students: "); for(x=0;x
@softwareupdater99
@softwareupdater99 Ай бұрын
Quiz =D=Junk value or Random value because slot or cell 4 is empty am I right?
@chaidiariess
@chaidiariess Жыл бұрын
Finally, here's my code! :> #include int main() { int marks[5]; float sum; float ave; printf("Enter 5 marks of a student: "); for(int i = 0;i < 5;i++) { int a = i + 1; printf("Subject %d: ", a); scanf("%d", &marks[i]); } sum = marks[0] + marks[1] + marks[2] + marks[3] + marks[4]; ave = sum/5; printf("The sum is: %.2f", sum); printf(" The average is: %.2f", ave); return 0; }
@nagashreenb4763
@nagashreenb4763 Ай бұрын
int main() { int subject[5],i,Totalmark,average; printf("enter the subject marks:"); for( i=0;i
@zindycangaming9851
@zindycangaming9851 Ай бұрын
10:57 the output is wrong it hast to be 16 but it is 6...
@mdt7672
@mdt7672 5 ай бұрын
11:28 you entered 16 in the 3rd index but the output was 6 😮
#20 C Multidimensional Arrays | C Programming For Beginners
10:44
#15  C Functions | C Programming for Beginners
16:57
Programiz
Рет қаралды 243 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
C_46 Arrays in C - part 1 | Introduction to Arrays
18:19
Jenny's Lectures CS IT
Рет қаралды 1 МЛН
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 7 МЛН
#23 C Pointers | C Programming For Beginners
11:01
Programiz
Рет қаралды 156 М.
Array Basics | C Programming Tutorial
13:37
Portfolio Courses
Рет қаралды 43 М.
#12: while Loop in C Programming |  C Programming for Beginners
12:23
#21 C Strings | C Programming For Beginners
10:13
Programiz
Рет қаралды 156 М.
you will never ask about pointers again after watching this video
8:03
#24 C Pointers and Arrays | C Programming For Beginners
9:56
Programiz
Рет қаралды 95 М.
#9: If Else Statements in C | C Programming for Beginners
12:28
Programiz
Рет қаралды 215 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН