4. main() {
int reset(int );
int i=5;
reset(i);
}
int reset(int n){
if(n==0)
return 0;
else
printf(“%d”, n);
reset(n--);
}
Output: infinite recursion. It continuously prints 5 and after some time stack overflow occurs.
5.
main(){
register int i;
int *ptr;
ptr = &i;
i=10;
printf(“%d”,*ptr);
}
Output: Compilation error. We cannot refer the address of a register variable
Custom Search
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment