HELLO WORLD
Let us write our first C program in C language. The problem is classic Hello world
Let us write our first C program in C language. The problem is classic Hello world
#include< stdio.h>
int main()
{
printf("HELLO WORLD\n");
return 0;
}
Go on and write the code in the editor, compile and run the code.
For linux users, type ctrl+alt+t to open the terminal. Then type vi hello_world.c
This will open a new file called hello_world.c .
hello world is the name of the file and .c is the extension that tells the compiler that this file is a c program source code
press "i" to start typing, "i" stands for insert mode. type the following code in the file.
To save and exit, press "esc" Then type ":x" and then enter. Now you have saved and exit.
To compile the code , type gcc hello_world.c. This will compile the code
Now the final step, type ./a.out to run the program