Last active
October 7, 2023 19:37
-
-
Save alexandreelise/f6bdc6e785a4f70b8d670bb3f23ef9c8 to your computer and use it in GitHub Desktop.
Tiny foodie hungry script now in C too. Originally in PHP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Tiny hungry foodie c script | |
* | |
* @package tinyhungryfoodie | |
* @author Mr Alexandre J-S William ELISÉ <code@apiadept.com> | |
* @copyright (c) 2009 - present . Mr Alexandre J-S William ELISÉ . Tous droits réservés. | |
* @license MIT | |
* @link https://apiadept.com | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
int main() { | |
//food must not be more than 24 characters long | |
char food[25]; | |
do { | |
printf("I am hungry:\n"); | |
fgets(food, 25, stdin); | |
printf("Miam! Miam! %s", food); | |
} while (strcmp(food, "end\n") != 0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment