Hello World Program in C

First hello world program in c; Through this tutorial, you will learn how to write the first hello world program in c programming language.

How to Make First Hello World Program in C

  • Simple Hello World Program In C
  • Hello World Program using Functions in C

Simple Hello World Program In C

#include <stdio.h>

int main()
{
    printf("Hello World");
    return 0;
}

Hello World Program using Functions in C

#include
void hello(){
	printf("Hello World");
}
int main()
{
   //Calling a function here
   hello();
   return 0;
}

Let’s start with a basic introduction of various code statements, which are used in the above C Hello World program; as shown below:

  • 1. #include <stdio.h> – This statement tells compiler to include this stdio.h file in the program. This is a standard input output file that contains the definitions of common input output functions such as scanf() and printf(). In the above program we are using printf() function.
  • 2. int main() – Here main() is the function name and int is the return type of this function. Every C program must have this function because the execution of program begins with the main() function. The 0 return value of this function represents successful execution of program while the return value 1 represents the unsuccessful execution of program. This is the reason we have return 0; statement at the end of this main function.
  • 3. printf("Hello World"); – This function displays the content within double quotes as it is on the screen.
  • 4. return 0; – As mentioned above, the value 0 means successful execution of main() function.

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *