I'm working on a project that does an algorithm with the given input. I have the input stored in a long. with the given input, I need to convert “number” into an array so I can have access to each digit. for example, if “number = 73757383” I need to convert that into an array: array = [7, 3, 7, 5, 7...] to be able to do the algorithm (multiply every other digit, then add the others together). But I can't seem to figure out how to do this. Any help is appropriate. Also just as a note, I'm using the cs50 library. Thank you!
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main(){
long credit;
int number;
int arr[digit];
int i;
do
{
credit = get_long("Number: ");
number = floor(log10(credit) + 1);
}
while (number < 13 || number > 16);