#include<stdio.h>
int print1To10(int);
int main()
{
int N=3;
printf("\nNumbers from 1 To 10 are: ");
print1To10(N);`
return 0;
}
int print1To10(int N)
{
if(N)
printf("%d",print1To10(N-1));
else
return 0;
}
Output of this code is found 011
,but if I add a space after %d
then output becomes 0 2 2
.Again If I further give a space after %d
the output becomes 0 3 3
and this incrementing goes on and on with incrementing space.Why this?
N:B:I'm a newbie and working on C and code-block IDE.