[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
C Programming Tutorial – 20 – What about more than two choices?
by
Tags:
Comments
47 responses to “C Programming Tutorial – 20 – What about more than two choices?”
-
I am new to coding. It was going smooth until loops and I observed a strange thing about it when I reached a program which was to print all prime numbers from 1 to n. There are so many variables declared and I basically want to know how, when and most importantly WHY do we declare so many variables. If someone can explain this, it will definitely be a game changer for me. Thanks in advance.
-
Why don't you use an ampersand sign before avg in your printf( "Average: %.2f", avg);
-
this is offensive to my grades
-
i am the 111,000 view yayyy
-
amazing
-
What is this for?
printf ("Average %.2f")
-
Thanks for these tutorials, Bucky
I started from null and now I know so much and even to program myself a little
Thank you! 🙂
P.S. still learning -
ahhahah
-
Sir, please don't record your videos full screen. It becomes easy ton read and understand fast when your videos are cropped and only the coding area is kept.
-
we could also use all as if statement. Than why we use else if can anyone tell me?
-
i Think he's not using he's channel anymore :/ .. u were the Best bucky i even seen.
(''And the only bucky in this damn planet n"); -
well i'm definitely dumb
-
Hey Bucky I think your videos are great! I have a question about Code Blocks… I used to type in functions like "printf" and before i finished typing code blocks used to auto detect what I wanted and now it's not doing that. Do you know how I could get Code Blocks to detect what function I want again? I don't know what I did in the settings but now I have to type the whole function instead of letting Code Blocks detect it for me.. Thanks!
-
Anyway you are a good teacher 🙂
-
Ini lebih bagus! lol
int main()
{
float penggal1;
float penggal2;
float penggal3;printf("Markah Penggal 1:n");
scanf(" %f", &penggal1);printf("Markah Penggal 2: n");
scanf(" %f", &penggal2);printf("Markah Penggal 3: n");
scanf(" %f", &penggal3);float purata = (penggal1 + penggal2 + penggal3) / 3;
printf("PURATA: %f.2 n", purata);if (purata >= 85) {
printf("Grade An");
} else if (purata >= 75) {
printf("Grade B n");
} else if (purata >= 65) {
printf("Grade C n");
} else if (purata >= 55) {
printf("Grade D n");
} else {
printf("Don't give up! try next time n");
}return 0;
} -
The people with less than 60% are the ones watching ur vids dawg. We aint dumb, just slow. Thanks for the help btw! Comp mid-term tomorrow!
-
thanks man i am getting better and better you are good but you pass some stuff but i got anyway
-
I love your tutorals dude thanks a lot !!
-
If grades decide intelligence then einstine would be called as dumb for all of his life
-
sir , i am typing 4 time the grade then i am getting average as 90, like 90 90 90 90 avg= 90; for same pgm?
#include <stdio.h>
#include <stdlib.h>
int main()
{
float grade1;
float grade2;
float grade3;
printf("enter your grade n");
scanf(" %f ", &grade1);
scanf(" %f ", &grade2);
scanf(" %f ",&grade3);float average= (grade1 + grade2 + grade3)/ 3;
printf("avg is %.2f", average);if (average>= 80)
{
printf(" n excellent");
}
else if( average>=70){
printf(" n good");
}else if (average>=60){
printf(" n ok");}
else {
printf(" n dumb");}
return(0);
} -
Doesn't any grade >90 also means >60 too ? Then why doesn't the code gets confused? Is it better to mention something like 60<average<=70 ?
-
where are the actual codes at? I didnt find on the website
-
Is the if statement the same in every language? I learned it in PHP, JavaScript, Java, C++, and Python and they are all very similar.
-
why is he using SPACE before %f ? I thought you should only use that when sacanning characters with %c
-
"You are dumb" hahahahaha
-
You are funny and that is the only reason I picked to watch your tutorials over others lol
-
int age;
char ad;
printf("adin nedir?");
scanf("%s",ad);printf("Nece yasin var?n");
scanf("%d",&age);if(age<15){
printf(" %s Uzgunem amma bu application senin ucun deil!",ad);
}
else{
printf(" %s Bu vebsayta qebul edildin",ad);
}
Have i got mistake i compile it and it says 0 error but when it opens after the 1st scanf it closes why?
+thenewboston -
where can i get this tutorial's code?
-
awesome. But why are you always humorous
-
Hurting my feelings Bucky, I am a dumb kid
-
So your website is not buckysroom anymore. So at thenewboston website. Where can I find the codes you are using in your tutorials here?
-
how am i going to learn if i cannot see the codes. because its too far
tutorial vids from 1 upto 15? is much better because its easy to see.. -
int main()
{
int age1;printf("Enter the age of your first kid. n");
scanf(" %d", &age1);if(age1 >= 16)
{
printf("Your first child can drive a car in USA. n");
}else if(age1 >= 18){
printf("Your first child can drive a car in EU and USA. n");
}else{
printf("Your first child cannot drive a car in USA nor in EU.");
}return 0;
}how can I make this code to write "Your first child can drive a car in USA." only for ages in range of 16 – 17 because whenever I write that age1>16 it never prints "Your first child can drive a car in EU and USA."
-
Pro tip:
instead of:
printf("Enter the first three grades:n");
scanf(" %f n %f n %f", &grade1);
scanf(" %f n %f n %f", &grade2);
scanf(" %f n %f n %f", &grade3);It can be shorten:
printf("Enter the first three grades:n");
scanf(" %f n %f n %f", &grade1, &grade2, &grade3); -
cool, it helped a lot and didnt fall sleep 😀 thanks a lot!! )))
-
I'm a pro at 13?
-
can i use (if..else if…else if) statements? Without using an else at the end?
-
can you give the link for your website to find the code used in the video. please and thank you
-
I am getting an error while compiling.. The error is expected expression before '%' token… How do I get past by this error?
-
Is there any other point to 'else if' than faster programs? you could just use a bunch of if-statements right after each other although in that case the program would have to check all of them
-
one-size-fits-all
-
We could have used only if SCCHHHtatements if we gave more accurate information about the grades? I see this is more easy but jus wondering if we could do it without else if
-
great help man , big help
-
For anyone looking to take this exercise to a higher level, here is my source code:
#include <stdio.h>
#include <stdlib.h>int main(){
float grade1;
float grade2;
float grade3;
float average;printf("Enter your three test gradesn");
scanf(" %f", &grade1);
scanf(" %f", &grade2);
scanf(" %f", &grade3);average = (grade1 + grade2 + grade3) / 3;
printf("Average: %.2f n", average);
if(average >= 90){
printf("You earned an A!");
}else if(average >= 80 && average <= 89){
printf("You earned a B");
}else if(average >= 70 && average <= 79){
printf("You earned a C");
}else if(average >= 60 && average <= 69){
printf("You earned a D");
}else{
printf("You earned a F");
}
return 0;
} -
One kid is dumb
-
Very useful tuts.
Leave a Reply