#include <cs50.h>
#include <stdio.h>
int main(void)
{
long creditcardno;
do
{
creditcardno = get_long("enter");
}
while (creditcardno < 1000000000000 || creditcardno > 9999999999999999);
int i = 0;
long cc = creditcardno;
while (cc > 0)
{
cc = creditcardno / 10;
i++;
}
printf("%d", i);
}
After accepting the input of number between 1000000000000 and 9999999999999999, the program seems get into some kind of infinite loop.
Reply
https://cs50.stackexchange.com/questions/41960/unable-to-move-to-the-next-chunk-of-the-problem[learn_press_profile]