Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Code Style

Name: Anonymous 2010-01-24 16:09

The following program demonstrates your tab width, indentation style, and various other aspects of your code style. Please write it (in verbatim) in your preferred style. Remember to use spaces instead of tabs, as shitchan automatically converts tabs into 3 space characters.

[code]#include "stdio.h"

int main (void)
{   int   x;
    char  c = 'a';
    float y = 0;
   
    for (x = 0; x < 10; x++)
    {   if  (x % 2 == 0)
            printf ("%d\n", x);
        else
        {   printf ("%c\n", c);
            c +=1;
        }
    }
   
    return 0;
}

Name: Anonymous 2010-01-26 16:35

int                                                            main   (                              void                                                                                       )                                                                     {
                                                                                                                                                                                             int                                                                                                                                                                                                                  x                                                         ;
                                                                                                                                                                                                                                                                                                    char                                                                                                                                                                 c                                                                          =        'a'                                                                          ;
                                                                                                                                                                                                                                                                                              float     y                                                                                =                                                                                                   0                                                                                         ;
                                                                                                                                                
                                                                                                                                                                                                                                                                                                                           for                                                                (                                                                  x                  =                                 0                                                                                            ;                                                                       x                                                   <                                                                                10                                                                 ;                                                     x++                                                        )                             {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        if                                                                                                                                     (                                    x                                         %                                                                          2                                                                                           ==                                                                         0                                                                 )                                                                                               {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        printf                                                                                  (                                       "%d\n"                ,                                                                         x           )                                                                             ;   }
                                                                                                                                                                                                                                                                                                                                                                                   else          {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               printf                                                                    (    "%c\n"                   ,                       c                                                                                                   )                                                                                  ;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  c                      +=          1     ;                                       }                                                                                        }
                                                                                                                                                         
                                                                                                                                                                                                                                                                  return                                  0                                                                                    ;                       }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List