Created
June 23, 2022 15:08
-
-
Save DeclanGas/97a3162b8197a6b3ff5c42bf494b6866 to your computer and use it in GitHub Desktop.
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
#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