This kid knew enough to be dangerous.


Running this old code, which was probably not actually turned in for anything, through the gcc compiler alone showed that there was a glaring error that would have been exposed on the the first run.

Beyond the initial compiler warnings, there are the ALL CAPS variables, the while loops used as pure for loops…


#include "stdio.h"
main()
{

    int rows,columns,ROW, COLUMN;
    scanf("%d %d",ROW,COLUMN);
    rows = 0;
    columns = 0;
    while(columns++ < COLUMN)
        printf("xdb");
    printf("n");
    rows += 1;
    while(rows++ < (ROW - 2)){
        columns = 0;
        printf("xdb");
        while(columns++ < (COLUMN - 2)){
            printf(" ");
            }
        printf("xdbn");
        }
    columns = 0;
    while(columns++ < COLUMN) {
        printf("xdb");
        }


}

Leave a Reply

%d bloggers like this: