Today I am going to explain you, how to print "Hello World" in C .
First of all we have to save the source code using a suitable name with .c extension. As C is a case sensitive language make sure that you are following the correct standards to use lower case for the file extension.
eg:- first.c
Then compile the code using a link . A linker links the object code with standard libraries for the missing functions mentioned in the source code.
eg:- gcc first.c -o first
Then load and execute the program using ./first command and press enter.
If you are using Ubuntu you must use ./first.out command and press enter.
Then load and execute the program using ./first command and press enter.
If you are using Ubuntu you must use ./first.out command and press enter.
C consist of set of standard libraries, while stdin(standard input stream) function take inputs from the code and stdout(standard output stream) function give the output of the code to the computer screen.
These functions are already defined inside the language library and to use these functions in the code we must include the corresponding header file at the beginning of the code.
eg:- stdio.h
(The header file of standard input and output stream)
Now let me show you the source code to print "Hello World".
Then compile the above code as mentioned above.
Now you can see the output printed as above.
I'll meet you with another blog post soon,
Till then,
Good bye.
These functions are already defined inside the language library and to use these functions in the code we must include the corresponding header file at the beginning of the code.
eg:- stdio.h
(The header file of standard input and output stream)
Now let me show you the source code to print "Hello World".
Then compile the above code as mentioned above.
I'll meet you with another blog post soon,
Till then,
Good bye.
Comments
Post a Comment