Hi,

I've an interesting task. Given a c program say hi.c as input to a
program, the program should be able to return a file hi1.c such that
all dead codes are removed from the source code submitted.


refer link to know abt dead code

http://en.wikipedia.org/wiki/Dead_code_elimination

int main(void) {
   int a = 5;
   int b = 6;
   int c;
   c = a * (b >> 1);
   if (0) {   /* DEBUG */
     printf("%d\n", c);
   }
   return c;
 }

in the above snippet if(0){ } is dead code as it'll never be executed
so the output shld be


int main(void) {
   int a = 5;
   int b = 6;
   int c;
   c = a * (b >> 1);
   return c;
 }

Any ideas as to how to solve this interesting problem ?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to