c - Why this for loop starts from half and not prints out every thing? -
I am learning C, I have written a program that allows the user to enter an initial number and end the number , And it tells the number from the starting point to the last digit. For example, if a user enters 5 as the starting number and gives 10 as the ending number, then it prints 5 6 7 8 9 10. Here's the code: -
#include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Int main () {int start; intend ; Int counter; // Initial number ask printf ("Enter initial number:"); Scanf ("% d", and start); // Final number ask printf ("Enter last number:"); Scanf ("% d", and end); (Counter = start; counter & lt; = end; counter ++) {printf ("% d \ n", counter); } Return 0; }
The above code runs entirely for short interval numbers (like 5 to 10, 1000 to 1025), but whenever I type in a large number like 100 to 500 digits I print it numbers, starting from 205 to 500, even I scroll, I can not get the numbers from 100 to 204. I am using Can anyone understand what is wrong with this code? Thank you :)
There is limited history in command line display, you are printing a large number of large numbers Old lines have been removed.
You can print numbers in the file using Fapen () and fprintf (), so that you can inspect them all.
Comments
Post a Comment