Wednesday, July 8, 2009

great outputs

>>
void myFunc (int x)
{
if (x > 0)
myFunc(--x);
printf("%d, ", x);
}
int main()
{
myFunc(5);
return 0;
}


output:-0, 0, 1, 2, 3, 4,

>>
int a=10,b;
b=a++ + ++a;
printf("%d,%d,%d,%d",b,a++,a,++a);


output:-22,13,13,13

comments
:-just change the a++ and then see the output and then change the ++a and then see the changes

No comments:

Post a Comment