Definition
📌 Introduction
C is a general-purpose, compiled programming language created in 1972 by Dennis Ritchie at Bell Labs.
Syntax
syntax
#include <stdio.h>
int main() {
// your code here
return 0;
}Example
c
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}Output
outputHello, World!
Important Points
- Every C program must have exactly one
main()function — that's the entry point. - C is a compiled language: source code (.c) is translated to machine code before it runs.
- Statements end with a semicolon
;. #includelines bring in standard library headers likestdio.h.
Common Mistakes
- Forgetting the semicolon at the end of a statement.
- Forgetting
return 0;at the end ofmain(). - Misspelling header names, e.g.
stdio.hasstudio.h.
Interview Tip
🎯 Before your interview
Interviewers often ask "is C compiled or interpreted?" — C source is compiled directly to native machine code, which is a big part of why it runs fast.
