Skip to content

Instantly share code, notes, and snippets.

@DeclanGas
Created June 23, 2022 15:09
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 DeclanGas/ee75a3d528dbbdc48cd13455ca34d9d1 to your computer and use it in GitHub Desktop.
Save DeclanGas/ee75a3d528dbbdc48cd13455ca34d9d1 to your computer and use it in GitHub Desktop.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int number;
// write your do-while loop here to accept input between 0 and 10
do
{
number = get_int("Enter a number between 0 and 10: ");
}
while (number < 0 || number > 10);
printf("Thank you for the %i!\n", number);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment