"HELLO WORLD" Program | How to print "Hello World" in C | Programming tutorials | C programming | C programming tutorials
Hello friends, after installing DEV C, in this blog we'll learn to write and compile our first ever program in C language and the program is to print "HELLO WORLD" in the output screen. So, Are you guys ready for your first program in C?
Here is your step by step guide to enable you to write your first program in C:-
First of all you have to open DEV C in your system and the opening window will look something like this
Then you have to click on File > New > Source file. It will open a new window for you in which you'll be able to write your code and the window will look like this:-
After opening a new file, you have to save the file first in order to compile and run the program. For saving the file, you will have to click on File > Save As and then choose the desired location and type the desired name to save the program.
Then you'll write your code to print "HELLO WORLD". As this is your first program, so no need to worry. Just copy the code shown below in the new file and enjoy writing your first program. And the code looks something like this:-
#include<stdio.h>
int main()
{
printf("HELLO WORLD");
return 0;
}
int main()
{
printf("HELLO WORLD");
return 0;
}
You just have to copy the entire piece of code to the new file. It's ok even if you don't understand a single thing at the time. We'll just discuss about the basics here and know about the rest of them later in the series. In the first line, there is "#include<stdio.h>" which is a header file and allows the user to take the input and display the output in the program. You don't have to worry about the second and third line as it is a part of the syntax of the program. In the 4th line, there is "printf("HELLO WORLD");" . This line is used to print "HELLO WORLD" in the output screen, where printf is used to print anything on the output screen. To get the output you will have to click on Execute > compile & run option.
And here you go, the output screen will look something like this:-
If you are unable to understand anything now at the moment. Don't worry, just assume that it is a part of syntax of the program and start enjoying your coding journey. We will discuss about the syntax in details in further details.
In our next blogs, we will learn about the Variables and Variable Declaration in detail . If you have any suggestion / Advice for us, feel free to let us know in the comment section. We will be happy enough to know your feedback. Also, your appreciation will motivate us to add more to this blog.
Till then, Stay safe & Stay healthy. Have a nice day!!
Comments
Post a Comment