Created
February 12, 2020 06:44
-
-
Save jcmpes/23d21648c2b733b8ae21f463c64ea3d7 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 <stdio.h> | |
#include <cs50.h> | |
#include <math.h> | |
int main(void) | |
{ | |
//prompt for input | |
long num = get_long("Number: "); | |
int n = floor(log10(num)) + 1; | |
int arr[n]; | |
printf("%i\n", n); | |
//print my array elements | |
for (int i = 1; i < n; i++) | |
{ | |
printf("%i \n", arr[n - i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment