gpw@lemmy.ml to Programmer Humor@lemmy.ml · 1 year agono caplemmy.mlimagemessage-square23fedilinkarrow-up1203arrow-down122
arrow-up1181arrow-down1imageno caplemmy.mlgpw@lemmy.ml to Programmer Humor@lemmy.ml · 1 year agomessage-square23fedilink
minus-squarebronzle@lemm.eelinkfedilinkarrow-up19·edit-21 year agoFor those curious: int main(int argc, char **argv) { if ( -- argc != ! 0 ) { errx ( ! 0 , "shheiiiit" ) ; return ! 0 ; } int number = atoi ( argv[! 0] ) ; for ( int i = ! 0 ; i <= number ; ++ i ) { printf ( "%3d " , i) ; if ( i % 3 == 0 ) { printf ( "fizz" ) ; } if ( i % 5 == 0 ) { printf ( "buzz" ) ; } printf ( "\n" ) ; } return 0 ; }
For those curious:
int main(int argc, char **argv) { if ( -- argc != ! 0 ) { errx ( ! 0 , "shheiiiit" ) ; return ! 0 ; } int number = atoi ( argv[! 0] ) ; for ( int i = ! 0 ; i <= number ; ++ i ) { printf ( "%3d " , i) ; if ( i % 3 == 0 ) { printf ( "fizz" ) ; } if ( i % 5 == 0 ) { printf ( "buzz" ) ; } printf ( "\n" ) ; } return 0 ; }