Number Guessing Game Project with C Programming and Flowgorithm
เขียนโปรแกรมทายตัวเลข
1. Number Guessing Game Project Source Code on C Programming with Dev C++ IDE
Name Guessing Game Source Code
#include <stdio.h>
int main() {
srand(time(0)); //Seed random number generator
int secret, guess;
guess = 0;
secret = rand() % 100 + 1; //(0-99)+1 --> 1 - 100;
//secret = 50+(rand() % (201-50)); --> 50 - 200
printf("Guess Number 1 to 100\n");
while (guess != secret) {
scanf("%d", &guess);
if (guess == secret) {
printf("Your guess = %d is Correct!\n", guess);
}
else if (guess > secret)
{
printf("Your guess = %d is too High\n", guess);
}
else
{
printf("Your guess = %d is too Low\n", guess);
}
}
printf("You're the Winner!\n");
printf("Thanks for playing!\n");
return 0;
}
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_1-1024x712.jpg)
Output
2. Name Guessing Game Project with Flowgorithm
Download Flowgorithm Software –> http://www.flowgorithm.org/download/index.html
Open Flowgorithm –> Creating Name Guessing Game
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_3-1024x702.jpg)
3. Set Code & Console View and Show Variable Watch
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_4-1-1024x651.jpg)
4. Test Number Guessing Game
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_5-1024x553.jpg)
5. Converting Source Code 28 Programming Languages on Flowgorithm
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_6.jpg)
6. Number Guessing Game with Python Programming
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_7.jpg)
7. Number Guessing Game with C++ Programming
8. Number Guessing Game with Java Programming
9. Number Guessing Game with JavaScript Programming
![](https://www.glurgeek.com/wp-content/uploads/2021/08/Lab1_10.jpg)
10. Number Guessing Game with MATLAB Programming