The program can also be written as #include #include int main() { int correctguess=5,i,guessnumber,triesleft=3; printf("enter the correct number to win "); for(i=0;i
@manipurihunabopa Жыл бұрын
How and where can I see the codes used in an app that we're using frequently, for example like, Facebook, Google, Excel, Chess etc
@Blackilykat3 жыл бұрын
I think how you made the guess count system the "outOfGuesses" should have been a boolean instead of an int
@SittnPurdy3 жыл бұрын
had trouble at first because my program wouldn't print out "Out of guesses" after purposely guessing incorrectly. anyway, how i fixed it is putting in }else{ outOfGuesses++; // instead of outOfGuesses ==1 } } if(outOfGuesses){ // instead of outOfGuesses==1 printf("Out of guesses"); just in case any of you were stuck on that like i was
@manuelaborda77492 жыл бұрын
thank you! your videos are so useful :)
@abirhasanarko10093 жыл бұрын
I did it in just 15 lines: #include int main() { int secretNumber = 5; int guess; int guessLimit = 3; int guessCount = 0; while(secretNumber != guess && guessCount < guessLimit) { printf("Enter a number: "); scanf("%d", &guess); guessCount++; } if(secretNumber != guess) { printf("You Lose!"); } else { printf("You Win!"); } return 0; }
@kouetewillis90623 жыл бұрын
I created three game with C-codeblocks and I want to create an android app for it.Can I have some once help please ?
@preetikabra57373 жыл бұрын
you have to learn dart,flutter and c# or java not from c
@ryantmar15 жыл бұрын
hello, i'm having some trouble with the code you wrote :( it is saying that variable 'guess' is used uninitialized whenever function'main' is called. Anyone have any idea how to fix this, i'm using 'gcc' to compile this stuff
@harshilkotamreddy4 жыл бұрын
You've probably figured this out already, but try setting guess to 0.
@shivendrakumartiwari34553 жыл бұрын
i tried creating mine without seeing his code. his code is short does the same work. #include #include int main() { int hidden_number = 5; int guess_number; int guess_count=0; int out_guess=0; while((guess_number != hidden_number)&& (guess_count
@gabehcuodsuoitneterp2032 жыл бұрын
10:26 🤫😅
@sai-no2ck Жыл бұрын
#include #include int main() { int secret = 1; int guess; int guesscount = 0; int guesslimit = 3; while(guess != secret && guesscount < guesslimit) { printf("Enter your gues: "); scanf("%d",&guess); guesscount++; } if(guess == secret) { printf("you won!"); } else if(guesscount >= guesslimit) { printf("out of Guesses!"); } return 0; }
@sai-no2ck Жыл бұрын
Mike ! I have not used the outofguesses variable and still I was able to the guessinggame. I am not able to understand the significance of *outofguesses* variable. Please explain!