Programming with C |
Here is a simple "Hello, World!" program written in C:
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
This program uses the #include
preprocessor directive to include the "stdio.h" header file, which contains the function printf()
. The main()
function is the entry point of the program, and it contains a single call to printf()
to print the string "Hello, World!" to the console. The return 0;
statement at the end of the function indicates that the program has completed successfully.
You can run this program by saving it in a file with a .c
extension and then compiling it using a C compiler such as GCC, and running the output binary.
Post a Comment