Loading content...
Loading content...
C is a general-purpose procedural programming language. It is known for its high performance, efficiency, and low-level memory access. Due to its speed, portability, and close interaction with hardware, C is widely used in system programming, embedded systems, and performance-critical applications.
#include <stdio.h>
int main(){
printf("Hello World");
return 0;
}plaintextCopy
Hello World#include <stdio.h>Header files contain function declarations and macro definitions that can be used in a program. The #include directive tells the preprocessor to include the contents of the specified header file before compilation.
stdio.h => Input and output functions
stdlib.h => Memory management and utility functions
string.h => String handling functions
math.h => Mathematical functions
stdint.h => Fixed-size integer data types
stddef.h => Standard type definitions and macros
int main()The main() function is the starting point of every C program. Program execution begins from this function.
int specifies the return type of the function.
main() is the function name.
Empty parentheses indicate that no arguments are passed.
{
printf("Hello World");
return 0;
}The function body contains the statements that the program executes. It is enclosed within curly braces {}.
// This prints Hello WorldComments are used to explain code and improve readability. They are ignored by the compiler and do not affect program execution.
printf("Hello World");A statement is an instruction given to the computer. In C, every statement ends with a semicolon (;).
The printf() function is used to display output on the screen.
return 0;The return statement ends the function and returns a value to the operating system.
0 indicates successful program execution.
Non-zero values generally indicate an error or abnormal termination.
To run a C program, you need:
A Text Editor (VS Code, CodeBlocks, Notepad++, etc.)
A C Compiler (GCC, Clang, Turbo C, etc.)
Write the program.
Save the file with a .c extension.
Compile the program.
Run the executable file.
View the output.
C is widely used in various fields:
Used in the development of operating systems such as Windows, Linux, and macOS.
Used in devices like washing machines, microwave ovens, printers, and microcontrollers.
Used to develop fast and efficient game engines.
Used for building compilers, assemblers, and interpreters.
Used in the development of high-performance database engines such as MySQL.
Used to program sensors, controllers, and smart devices.
Used to build lightweight and high-performance desktop software.
C was developed by Dennis Ritchie in 1972 at Bell Labs for developing the UNIX operating system.
High performance
Low-level memory access
Portability
Structured programming
Efficient resource management
ANSI C
C99
C11
C23
Over time, these standards introduced new features and improvements while maintaining the simplicity and efficiency of the language.