I have written a program that prints a table. I have not included the return syntax in the main function, but still whenever I type echo $? it displays 12.
My source code :
#include <stdio.h>
int main(void)
{
int ans,i,n;
printf("enter the no. : ");
scanf("%d",&n);
for(i=1;i<=10;i++)
{
ans = n*i;
printf("%d * %d = %d
",n,i,ans);
}
}
I have not written return 12, but still it returns 12 every time I execute the program.
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…