Introduction to C Programming
Emna
July 26, 2025
1 What is C?
C is a general-purpose, procedural programming language developed in the early 1970s. It
provides low-level access to memory and is often used in systems programming, embedded
systems, and developing operating systems.
2 Basic Structure of a C Program
# include < stdio .h >
int main () {
printf ( " Hello , ␣ World !\ n " ) ;
return 0;
}
3 Key Concepts
• Variables and Data Types
• Control Flow (if, else, switch)
• Loops (for, while, do-while)
• Functions
• Pointers
• Arrays and Strings
1
4 Example: Adding Two Numbers
# include < stdio .h >
int add ( int a , int b ) {
return a + b ;
}
int main () {
int result = add (5 , 3) ;
printf ( " Sum : ␣ % d \ n " , result ) ;
return 0;
}
5 Pointers Example
# include < stdio .h >
int main () {
int x = 10;
int * p = & x ;
printf ( " Value ␣ of ␣ x : ␣ % d \ n " , * p ) ;
return 0;
}
6 Conclusion
C remains a foundational language in computer science and engineering. Its performance,
portability, and flexibility make it ideal for learning programming and building system-level
software.