Write Your First C Program - Codingque

Welcome to C Programming Tutorial

Your guide to getting started with C programming.

Write Your First C Program

#include <stdio.h>    // Include the standard input-output library
int main() {          // Define the main function, which is the entry point of the program
    printf("Hello, World!\\n");  // Call the printf function to print "Hello, World!" followed by a newline
    return 0;         // Return 0 to indicate successful execution
}                     // End of the main function

#include <stdio.h>
Includes the standard I/O library for functions like printf.

int main()
Defines the main function, the starting point of a C program. Returns an integer to the operating system.

printf("Hello, World!\\n");
Prints "Hello, World!" to the screen followed by a newline.

return 0;
Ends the main function, returning 0 to indicate successful execution.

}
Closes the main function.

Previous Next
Modern Footer