// (') Single quotation marks is for single character // (") Double quotation marks is for string
@wenndyarreguin11443 жыл бұрын
God bless you!
@FileFN32 жыл бұрын
I put all the code in correctly but when i get to num2 it just says the Else even if i put the correct op
@JJHanna3 жыл бұрын
Thank you so much!
@FileFN32 жыл бұрын
Evan though i put char op; at the start?
@Impromptu215 жыл бұрын
why there is space before %c while scanning character. and is this only for character or for only operators. piz sir answer it
@viveksuman96004 жыл бұрын
omg, this was the error. tysm!
@phamtuanduongk16_hl433 жыл бұрын
you can chage %c to %s that is easy to compiler
@mampuiapachuau83810 ай бұрын
Thank you so much.Because of your comment,I just know why I can't input an operator and second number :-)
@FileFN32 жыл бұрын
And then it says dash: 2: op not found
@ihssancanimturk_sayfor10 ай бұрын
why when I am asking the user to type an operator, it does not give the chance to type, but cancel the line code and do the next step me think?
@ihssancanimturk_sayfor10 ай бұрын
the code is as bellow, pls check it up: int main() { double num1; double num2; char op; printf("First Number: "); scanf("%lf", &num1); printf("An operator: "); scanf("%c", &op); printf("Second Number: "); scanf("%lf", &num2); if(op == '+'){ printf(" The Answer: %f ", num1+num2); }else if(op == '-'){ printf(" The Answer: %f ", num1-num2); }else if(op == '*'){ printf(" The Answer: %f ", num1*num2); }else if(op == '/'){ printf(" The Answer: %f ", num1/num2); } return 0; }
@shivendrakumartiwari34554 жыл бұрын
i tried giving num1 = 5, op=* , and num2=t. it printed 80. does anyone knows y? does it take ascii value of t?
@abheek-portfolio3 жыл бұрын
Yeah, that would be my guess, especially since we know that when you tell the computer to read for a number, and then you enter a character, it converts it and take the integer value from ASCII
@pakapeta77722 жыл бұрын
How about the numbers? What if I put characters at the "Enter a number: " part? It won't work, right?
@whisperscribe Жыл бұрын
You should try and watch the results! Experimenting is great for programmers!
@zandovic5 жыл бұрын
Is there a reason for why the %c doesn't work without the space in front? No problem doing it, just might be easier to remember if there is a legit software-related reason.
@XtraCraftinGame5 жыл бұрын
so you don't register the /n instaed
@furyingfox42934 жыл бұрын
It will write Enter Operator on the same line as Enter a number
@DieterHoremans7775 жыл бұрын
the code doesn't work 100% for me, here is a screenshot prntscr.com/n9sahl
@pakapeta77722 жыл бұрын
What are you trying to say?
@ChichaPapi6 жыл бұрын
check your code in mikedane.com for this video
@emzgalante26403 жыл бұрын
Thanks Mike your an amazing teacher. I have have learned a tremendous amount from your 'Learn Python - Full Course for Beginners [Tutorial] @freeCodeCamp.org. You're are a great guy and your explanation of coding is understandable, interesting and most importantly results-oriented. Thanks to your informative lessons I have choosen to keep going and not give up my pursuit of coding mastery. Regardless of how many years it may take me, thanks again your a legend (and a coding beast). How many programming languages do you actually know?