This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: printf("Please enter a number between 1 and 9999\n"); scanf("%d", &user_num); //calculating # of digits a = user_num / 1000; if (a == 0) {num_count = num_count; } else { num_count++;} b = user_num  (a * 1000); c = b / 100; if (c == 0) {num_count = num_count; } else { num_count++;} d = b  (c * 100); e = d / 10; if (e == 0) {num_count = num_count; } else {num_count++;} f = d  (e *10); g = f / 1; if (g == 0) {num_count = num_count; } else {num_count++;} //tells user how many digits are in the value entered printf("\nThe number you entered has %d digits in it.", num_count); return (0); }...
View
Full Document
 Spring '08
 Parikh
 Numerical digit, #, Tell, #include, 3 digit, digit count calculations*/

Click to edit the document details