Hello World Program in C

Hello coders, in this post we will learn how to write hello world program in c language. This is a very basic C program.

As you already know that this site does not contain only c programming solutions here, you can also find the solution for other problems. I.e. Web Technology, Data StructuresRDBMS ProgramsJava Programs Solutions,  Fiverr Skills Test answersGoogle Course AnswersLinkedin Assessment, Leetcode Solutions, and Coursera Quiz Answers.

Hello World Program in C
Hello World Program in C

How “Hello, World!” program works?

  • The #include is a preprocessor command that tells the compiler to include the contents of stdio.h (standard input and output) file in the program.
  • The stdio.h file contains functions such as scanf() and printf() to take input and display output respectively.
  • If you use the printf() function without writing, the program will not compile.
  • The execution of a C program starts from the main() function.
  • printf() is a library function to send formatted output to the screen. In this program, printf() displays Hello, World! text on the screen.
  • The return 0; a statement is the “Exit status” of the program. In simple terms, the program ends with this statement.

Hello World Program in C

#include <stdio.h>
int main()
{
    printf("hello, world\n");
}

Output

Hello, World!

Hello World Program in C using Functions

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

Output

Hello, World!

if you want to learn C programming free of cost please visit:

Conclusion

I hope after going through this post, you understand how to write hello world program in c language, if there is any case program is not working and showing an error please let me know in the comment section.

Sharing Is Caring

Leave a Comment