Skip to content

Instantly share code, notes, and snippets.

@DeclanGas
Created June 23, 2022 15:08
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/97a3162b8197a6b3ff5c42bf494b6866 to your computer and use it in GitHub Desktop.
Save DeclanGas/97a3162b8197a6b3ff5c42bf494b6866 to your computer and use it in GitHub Desktop.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int n = get_int("Enter a number: ");
int counter = 0;
// add your code here
while (n < 100)
{
n = n * 2;
counter++;
}
printf("Your number can be doubled %i times before reaching 100!\n", counter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment