Implement a C beautifier program. Following beautifications are needed.a. Tab is replaced by 4 spacesb. After every starting brace ie. {, the next statement will start 4 spaces away from the starting of the line that contains opening brace.Example 1:#include <stdio.h> main() /* Hello there */{ int x = 0;/* This is a comment */while (x< 10) { x ++; } if (x) { x++; } else { y = 0; } } Expected output:#include <stdio.h> main() /* Hello there */{ int x = 0; /* This is a comment */ while(x<10) { x ++; } if(x) { x++; } else { y=0; } }
451 Views |
No comments yet.