hi, its been some time since i have posted anything on this forum.. anyway, here goes:
This program should printCode:void abc(void) { < TO BE FILLED UP > } int main() { int i=10; abc(); i=1; printf(" i = %d\n",i); return 0; }
Code:i=10
The problem is to write the function abc() to get the required output
The function abc() takes in no arguments and returns void..
**** WE ARE NOT ALLOWED TO USE "printf()" INSIDE abc() ****
This is what i could think of :
Instructions are stored in a contiguous manner.. If I can cleverly modify Program Counter to skip the statement
and continue execution from the statement ,Code:i=1;
The problem can be solved..Code:printf(" i = %d\n",i);
I have no idea how to actually do it.. Can someone help me? Or is there a better method?