🔥Finding it Damn Hard to Understand C Programming? Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT! Try Programiz PRO for Free: bit.ly/master-c-programming
#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; }
#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; }
Awesome and crisp explanation. Keep making more videos to cover the entire language. Your series is really very crisp ,informational and easily understandable.
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 ❤😊
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
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.
@@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
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!
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
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.
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; }
#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; }
Option C : 0 ----------------------------------------------------------------------------- #include int main() { int marks[5], total = 0; printf("Enter Marks Of Five Subjects : "); for(int i =0; i < 5; i++) { scanf("%d", &marks[i]); total = total + marks[i]; } printf("Average Mark = %d", total/5); return 0; }
// Online C compiler to run C program online #include int main() { int marks[5]; double total = 0; double average; printf("Enter marks for the five subjects: "); for (int i = 0; i < 5; i++) { scanf("%d", &marks[i]); total = total + marks[i]; } printf(" The total marks is %.2lf ", total); average = total / 5; printf(" The average is %.2lf ", average); return 0; }
#include int main() { // Create an array that stores the marks of 5 subjects int marks[] = {75, 80, 85, 90, 95}; // Compute the total marks by adding all the marks int total_marks = 0; for (int i = 0; i < 5; i++) { total_marks += marks[i]; } // Divide the total marks by total number of subjects int number_of_subjects = sizeof(marks) / sizeof(marks[0]); float average_marks = (float)total_marks / number_of_subjects; // Print the average marks printf("Average marks: %.2f ", average_marks); return 0; }
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.
[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
#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);
#include int main() { int subjects,marks[10]; int i,sum=0,average; printf("Enter how many subjects:-"); scanf("%d",&subjects); printf("Enter the marks you obtained:-"); for(i=0;i
#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; }
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); }
#include int main(){ int marks[5]; float total; for (int i = 0; i < 5; i++) { scanf("%d",&marks[i]); } for (int i = 0; i < 5; i++) { total = marks[i] + total; } int mark = sizeof(marks)/sizeof(marks[0]); total = total / mark; printf("the average marks is %.2f ",total);
#include int main () { int grade [5]; int total = 0; int avg = 0; printf("enter the grade of 5 subj: "); for(int i = 0; i < 5; ++i) { scanf("%d", &grade[i]); total = total + grade[i]; } printf("avrege = %d", total / 5); return 0; }
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; }
🔥Finding it Damn Hard to Understand C Programming?
Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT!
Try Programiz PRO for Free: bit.ly/master-c-programming
#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;
}
@@AbhiramDeshpande-fe1vi I made mine a bit more complex lol.
#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;
}
I Like your teaching method. keep posting such contents free for the student.
thank you.....
Awesome and crisp explanation. Keep making more videos to cover the entire language. Your series is really very crisp ,informational and easily understandable.
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 ❤😊
Yes, it is 0, but the reason is not that.
sok tau kau deck
#include
int main() {
int marks[5];
for(int i=0;i
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
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.
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
@@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
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!
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
Thnx broo
Good but its good programming practice that you initialize avg as int avg and then add avg=sum/5 and print it.
I suggest you remove the printf("Entre the marks "); out of the for loop.
I appreciate this. I missunderstood the wording of the quiz and this made me understand what she was asking for
clear, concise and to the point explanation Thank you.
at 11.30 why did the output come as 6 instead of 16 ?
I did notice too. Just guessing, but might be a bug in the compiler?
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.
I love her english, so different and unique to grasp even better
#include
int main() {
// Write C code here
int marks[5]={56,45,67,87,56};
int totalMarks = marks[0] + marks[1] + marks[2] + marks[3] + marks[4];
double averageMarks= totalMarks/5.0;
printf("The total marks scored = %d
",totalMarks);
printf("The averageMark = %.2lf
",averageMarks);
return 0;
}
11:27 somehow returned "6" instead of "16" in age[3]?
I'm also puzzled by this
am yet to find best teacher thank you for your content it really makes it easier to learn and grasp info on c programming.
#include
int main()
{
int i;
double avg;
double marks[5];
printf("Enter marks of 5 subjects:");
for(i=0 ;i
#include
int main()
{
int marks[5];
int i,sum=0,average;
printf("Enter marks of 5 subjects");
for (i = 0; i
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;
}
One of the best teaching method, please go ahead and make more contents like this
#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;
}
i love it when she says "jero"
Thabks alot this woll surely hwlp me for today HND exams i have .
At 11:30 it printed 6 instead of 16 .. Why? 😳
Same question too
Does the same at 12:09. I think it's just a bug in the compiler.
ANSWER
#include
int main()
{
int i;
int marks[5];
int total=0;
printf("enter the marks: ");
for(i=0;i
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
Thank you !
Great explanation,Simple but precise and also great initiative on making this videos available to all !
Option C : 0
-----------------------------------------------------------------------------
#include
int main()
{
int marks[5], total = 0;
printf("Enter Marks Of Five Subjects : ");
for(int i =0; i < 5; i++)
{
scanf("%d", &marks[i]);
total = total + marks[i];
}
printf("Average Mark = %d", total/5);
return 0;
}
Haa nhasi ndopandatozonzwisisa ma array after a long time. Well done parohwa basa apa🙌🤝
#include
int main() {
int subjmarks[5];
printf("enter marks of 5subjects: ");
for(int s=0;s
This is the best videos!
in the for loop you had an input of 16 but printed out as 6 in the compiler, what could be the problem
I Like your teaching method. keep posting such contents free for the student. Thank you answer is 0
D. Random value
I guess you haven't considered the size of the array, so it is 0.
hello. I like however you teach or share us about your skills. thank you alot.
// Online C compiler to run C program online
#include
int main() {
int marks[5];
double total = 0;
double average;
printf("Enter marks for the five subjects: ");
for (int i = 0; i < 5; i++) {
scanf("%d", &marks[i]);
total = total + marks[i];
}
printf("
The total marks is %.2lf ", total);
average = total / 5;
printf("
The average is %.2lf ", average);
return 0;
}
Great and simply explained too good
And the answer is( c) . 0
Thank you very much for these videos. Your websites also give excellent content. Keep up the great work.
thank you very very very much, you help me a lot
thanks! but why do you pronounce g as z an z as g?
nice class and this are best in business
i found it interesting 😊 i like it
#include
int main( )
{ int marks[5], i;
int sum=0;
float avg;
for(i=0;i
At 11:25 why u used ++i instead of i++
#include
int main() {
// Create an array that stores the marks of 5 subjects
int marks[] = {75, 80, 85, 90, 95};
// Compute the total marks by adding all the marks
int total_marks = 0;
for (int i = 0; i < 5; i++) {
total_marks += marks[i];
}
// Divide the total marks by total number of subjects
int number_of_subjects = sizeof(marks) / sizeof(marks[0]);
float average_marks = (float)total_marks / number_of_subjects;
// Print the average marks
printf("Average marks: %.2f
", average_marks);
return 0;
}
I might be wrong but the answer to the question in the end is Random value, option (D)
#include
int main(){
int marks[5];
int total=0;
for(int i=0;i
The output of that code is option (d) Random Value
That's what I thought, apparently their github repository says different.
@@maxwell4466 Can you provide me their gitHub repository link?
your understanding is so good
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.
[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
0
Answer:- 0
Garbage Value
0 is the default value for any element not initialized by the user
0 will be the answer bcz size is exceeding the array.
Excellent to understanding... Tqsm mam...
Thank you so much for the video !
I understand this more than from my class lol.
Thank you mam 😊
Very very helpful,thank you keep it up
#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);
}
I really like your explanation.....
#include
#define A 5
int main ()
{
int age[A];
int sum=0;
double b=0;
printf("enter 5 numbers here : ");
for(int i=0;i
best channel ever thank you hanım abla
int main() {
int marks[5],sum,avg,x;
printf("Please enter the grades of 5 students:
");
for(x=0;x
#include
int main() {
int marks[5];
int sum = 0;
printf("enter the marks for all 5 subjects : ");
for(int x=0 ; x < 5; x++) {
scanf("%d" , &marks[x]);
}
printf("the marks are-: ");
for(int x=0 ; x < 5 ; x++) {
printf("%d " , marks[x]);
sum += marks[x];
}
printf("
total is = %d" , sum);
int avgMarks;
avgMarks = sum/5;
printf("
the avg marks are -: %d" , sum/5);
return 0;
}
#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
programming task-
int marks[5];
printf(" Enter the marks of 5 different subjects of a student:");
for (int i=0; i
Arrays is very easy with you.
#include
int main() {
int subjects,marks[10];
int i,sum=0,average;
printf("Enter how many subjects:-");
scanf("%d",&subjects);
printf("Enter the marks you obtained:-");
for(i=0;i
Assomone explanation mam👍👍👍👍
#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;
}
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;
}
I love programmiz😊😊😊 5:11
Thanks a bunch.
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);
guyz haru ta nepali po raixan so proud of that
Great Explanation, Thank you for the same.
Nice explanation mam
#include
int main(){
int marks[5];
float total;
for (int i = 0; i < 5; i++)
{
scanf("%d",&marks[i]);
}
for (int i = 0; i < 5; i++)
{
total = marks[i] + total;
}
int mark = sizeof(marks)/sizeof(marks[0]);
total = total / mark;
printf("the average marks is %.2f ",total);
}
Nice my teacher 🙏🙏🎉🎉
Thank you mam give more things of array,🥰🥰
#include
int main () {
int grade [5];
int total = 0;
int avg = 0;
printf("enter the grade of 5 subj: ");
for(int i = 0; i < 5; ++i) {
scanf("%d", &grade[i]);
total = total + grade[i];
}
printf("avrege = %d", total / 5);
return 0;
}
Superb explanation 🙏
Thank you.
8:48 why the output is not 25, and what if i want 25 what should i do?
Thankyou!
#include
int main(){
double marks[5];
int i;
double sum = 0;
for(i = 0;i
I love her accent ❤️☺️
thanks a lot
thanks
so good👌
Ans is - D. Random value because we are trying to access uninitialized value
very nice video 😊😊😊❤❤❤🙏mam
13:09 the answer is 0 right?
Wow I like the way you pronounce zero. You're the best 👌 ever 💓
i love your videos
Animo joel tu puedes
great vide
Happy programming 🎉
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;
}
May I know where we can use new line character "/n"