Do you mean you would like to print integers out on the screen?
Print Integers in a Loop
You can loop through a set of numbers and print each one of them one by one.
In the following example we start from 0 and end before reaching 10, so our last number is 9. After every number we also add a space. "%d" means, we want to print a decimal number, so the second argument of printf is the decimal number we would like to print. For details, see printf().
#include <stdio.h>
int main()
{
for (int i = 0; i < 10; i++)
{
printf("%d ", i);
}
return 0;
}
Print Integers in an Array
There is another typical scenario. You have an array, and you would like to print the content of this array. In this case, you'd write something, like this:
#include <stdio.h>
#define count 5
int main()
{
int numbers[count] = { 5, 6, 9, 8, 2 };
for (int i = 0; i < count; i++)
{
printf("%d ", numbers[i]);
}
return 0;
}
So we created a macro called count so we know how many elements are in our array. Then in the loop, we iterate through these elements one by one and print them.
I hope this helps.
Good luck! :)