Skip to content

Instantly share code, notes, and snippets.

@alexandreelise
Last active October 7, 2023 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandreelise/f6bdc6e785a4f70b8d670bb3f23ef9c8 to your computer and use it in GitHub Desktop.
Save alexandreelise/f6bdc6e785a4f70b8d670bb3f23ef9c8 to your computer and use it in GitHub Desktop.
Tiny foodie hungry script now in C too. Originally in PHP.
/**
* 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