Compile the source file by issuing the command cc foo.c in an xterm window. If there are no errors in your code, this creates a binary a.out. You execute the binary by issuing the command a.out in an xterm window.
If you want to name the binary foo, compile the source with the command cc foo.c -o foo . You execute this binary by issuing the command foo in an xterm window.
The text between /* and */ is a comment. The compiler ignores it.
/* hello.c */ #include <stdio.h> int main() { printf("Hello!\n"); }
/* hello1.c */ #include <stdio.h> int main() { printf("Hello!\n"); printf("Hello!\n"); printf("Hello!\n"); }
/* hello2.c*/ #include <stdio.h> int main() { int i; for(i=1; i < 10; i = i+1) { printf("%d. Hello!\n",i); } }
/* This is a comment. */Formatting with the