/* * Name: Name of program * Purpose: what program does * Author: your login * Date: the date */ /* multi line comments must start with a /* and end with */ //single line comments must start with // and don't have to end with anything /* * the indentation seen in this file makes the code easier to read. we strongly suggest that you do it this way. * if you want to make gedit indent automatically look in the Edit > Preferences > Editor and Plugins or ask a TA during lab or hours. */ #include /* comment on what this function does */ int main() { int x = 0; int y; /*variable declarations. All variables need to be declared before used*/ printf("stuff\n"); /* lines of code must end in ';' note the '\n' which inserts a newline. it's good form to end print statements with one so that the next print starts on a new line*/ if (x == 2) { //these brackets and parentheses are REQUIRED!!! Don't forget them! // do stuff here } else { // do more here } while (x < 4) { // do stuff here // change x } int i = 0; /* i must be defined before the for loop */ for (i = 0; i < 10; i++) { // do stuff here } if (x==0) { if (y==2) { // do stuff here } } return 0; }