You should call the function like this:

int main() {    
  PRINT();
}
Answer from Răzvan Rujoiu on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-hello-world-program
C Hello World Program - GeeksforGeeks
printf(“Hello, World!\n”); – This function call prints “Hello, World!” followed by a new line. return 0; -This statement indicates that the program ended successfully.
Published   July 12, 2025
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_hello_world.htm
C - Hello World
The next statement calls the printf() function. In C, every statement must terminate with a semicolon symbol (;), failing which the compiler reports an error. The printf() function, imported from the stdio.h library file, echoes the Hello World ...
Discussions

Print function, hello world in C - Stack Overflow
Started reading C a few days back, I'm trying to learn how to split my code into functions, can anyone tell me why my code not printing hello world for me? #include void PRINT() { ... More on stackoverflow.com
🌐 stackoverflow.com
Printf("Hello world!");
The 2 functions does not return any value so you don't have to print anything just call them in main. More on reddit.com
🌐 r/cprogramming
8
1
October 29, 2019
Perfect hello world in C!
What is the point if using a macro for the arguments when doing it regularly is less space less cluttered and more readable? What is the point of formatting a string in printf when just passing the literal is less space less cluttered and more readable? More on reddit.com
🌐 r/cprogramming
22
0
June 11, 2024
Learning C, No. 1: Hello World
Quite a few of your explanations contain subtle mistakes. An include mechanism if there are external libraries are needed, like here the puts function While include is often used to pull in declarations from libraries, it' not really required, nor is that the only function. But I get why you'd want so simplify this for beginners.. An main function as entry point older C compiler where OK with return type ‘void’ Strictly speaking int main (void) and int main (int argc, char *argv[]) are the only signatures, and only in a hosted environment. Since C99 implementation-defined signatures are allowed. A simple function like puts that does something, puts is defined in the included library It's declared in the header. The function definition is somewhre else. A return function that satisfies the function type for main also older C compilers did not need that Return is not a function, and for main it's optional since C99. More on reddit.com
🌐 r/C_Programming
6
0
September 6, 2024
🌐
W3Schools
w3schools.com › c › c_output.php
C Output (Print Text)
To output values or print text in C, you can use the printf() function: #include <stdio.h> int main() { printf("Hello World!"); return 0; } Try it Yourself » · When you want to print text, the text must be wrapped in double quotes "". If you ...
🌐
Quora
quora.com › How-can-Hello-world-be-written-in-C-C-using-only-one-line-of-code
How can 'Hello world' be written in C/C++ using only one line of code? - Quora
Some might consider using the puts function instead of the printf function. That would work, too, but the traditional C “hello world” program uses printf, and there’s something to be said for tradition.
🌐
Programiz
programiz.com › c-programming › examples › print-sentence
C "Hello, World!" Program
Become a certified C programmer. Try Programiz PRO! ... #include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; }
🌐
Instructables
instructables.com › teachers › university+
How to Create Hello World in C : 6 Steps - Instructables
June 20, 2023 - For Example it would look like printf(“Hello World!\n”);. This tells the program to have a new line after you print Hello World!. The final step would be to run your code by pressing the play button on the top right of your screen, then ...
Find elsewhere
🌐
CodeChef
codechef.com › practice › course › c › LPCAS01 › problems › LCAS03
Hello World! Question in C
Test your Learn C knowledge with our Hello World! practice problem. Dive into the world of c challenges at CodeChef.
🌐
Udemy
blog.udemy.com › home › how to write your first hello world program in c
How To Write Your First Hello World Program In C - Udemy Blog
May 5, 2022 - That’s a “printing/displaying to screen” function we can use thanks to the methods that were “included” from the “stdio.h”. The printf function gets the text between the “quotation marks” and displays it on the screen.
🌐
W3Schools
w3schools.com › c › c_getstarted.php
Get Started with C
Write the following C code and save the file as myfirstprogram.c (File > Save File as): #include <stdio.h> int main() { printf("Hello World!"); return 0; }
🌐
HackerRank
hackerrank.com › challenges › hello-world-c › problem
"Hello World!" in C | HackerRank
This challenge requires you to print on a single line, and then print the already provided input string to stdout. If you are not familiar with C, you may want to read about the printf() command. ... Complete the main() function below.
🌐
Ucdavis
scalettar.physics.ucdavis.edu › cosmos › helloworldC.pdf pdf
1 C PROGRAMMING: HELLO WORLD AND ADD!
... The first line is a comment line. The compiler gcc ignores text between /* and */. Including · comments when you write code is very useful, especially as programs get longer. The second line · tells the compiler to include information about commands like “printf...
🌐
Reddit
reddit.com › r/cprogramming › printf("hello world!");
r/cprogramming on Reddit: Printf("Hello world!");
October 29, 2019 -

Hello world!

So I'm new to programming and I was trying to write a function "loop1" that adds 1 untill it got to 20 and for every result it would print it to the screen.Then I called the function loop1 before the main() And in the main() function I called a printf that outputs the results from loop1.

This all works but... when I add another function loop2 that adds 2 untill it gets to 20 and call it in the same way only the 1st loop gets printed out to the screen.

#include <stdio.h>

int loop1();
int loop2();

int main()
{
    printf(loop1());
    printf(loop2());
    return 0;
}

int loop1()
{
    int incr = 0;
    while( incr <= 20)    
    {    
         printf("%i\n", incr);    
         incr++;    
     }    
}

int loop2()
{
    for( int incr = 0; incr <= 20; incr = incr + 2)
    {
        printf("%i\n", incr);
    }
}

This what I wrote but only the results of loop1 are getting printed to the screen.What am I doing wrong?

Ps: If you are wondering why I'm using 2 different methods to add it's because I'm new to programming and am still learning.
🌐
Unstop
unstop.com › home › blog › hello world program in c | easy ways explained +code examples
Hello World Program In C | Easy Ways Explained +Code Examples
August 13, 2024 - The Hello World program in C is a simple program whose purpose is to display the message- "Hello, World!" to the console. The program generally consists of a printf() statement with the message, and it is a great way for beginners to get started ...
🌐
Quora
quora.com › Which-is-the-C-programming-code-for-printing-Hello-world
Which is the C programming code for printing “Hello, world”? - Quora
Answer: priting hello, world is simple and everyones first program in C programing language. This following code is compiled and run in Turbo C++ #include #include void main () { clrscr(); printf("Hello, world"); getch(); }
🌐
Programiz
programiz.com › cpp-programming › examples › print-sentence
C++ "Hello, World!" Program
In our example, "Hello World!" is the format string. Note: ; is used to indicate the end of a statement. return 0; The return 0; statement is the "Exit status" of the program. In simple terms, the program ends with this statement. We use std:cout in order to print output on the screen.
🌐
BeginnersBook
beginnersbook.com › 2017 › 09 › c-hello-world-program
Hello World Program in C
In this program we have created ... read this guide: User Defined Function in C. #include void hello(){ printf("Hello World"); } int main() { //Calling a function here hello(); return 0; }...
🌐
Scaler
scaler.com › home › topics › hello world program in c
Hello World Program in C
March 5, 2024 - We have passed 13 arguments in ... in a sequence of required output (Hello, World!). printf("%c%c%c%c%c%c %c%c%c%c%c%c", a, b, c, c, d, e, f, d, g, c, h, i);....
🌐
Wikipedia
en.wikipedia.org › wiki › "Hello,_World!"_program
"Hello, World!" program - Wikipedia
5 days ago - The function body consists of a single statement, a call to the printf() function, which stands for "print formatted"; it outputs to the console whatever is passed to it as the parameter, in this case the string "hello, world".