- 1). Begin by importing the necessary language libraries to use the terminal emulator with the line "#include <stdio.h>" at the very top of your source code.
- 2). Write the main function by typing "int main() {" two lines below the first line of your program.
- 3). Press the tab key on the line immediately below the "int main() {" line. This is necessary, as C requires you to indent each line that is part of a particular function. Type "printf("Hello, World!");" after your indent. You can either keep the traditional message of every coder's first program in a particular language, or replace "Hello, World!" with a message of your own choosing.
- 4). Type "}" on the next line, to close the main function. This source code will compile as an application that will display the message in your "printf" function in a terminal emulator.
previous post