C programming Notes For beginners ( Easy+ Detailed Guide)
π C Programming Notes for Beginners (Easy + Detailed Guide)
Hello everyone π
Welcome back to my blog!
Want to learn C programming quickly? These simple and detailed notes will help you understand the basics step by step. Perfect for beginners and BCA students π
---
π What is C?
C is a procedural programming language used for:
- System programming
- Operating systems
- Embedded systems
π It is fast, powerful, and widely used.
---
π§© Structure of a C Program
#include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
Explanation:
- "#include <stdio.h>" → Header file
- "main()" → Starting point of program
- "printf()" → Output function
- "return 0" → End of program
---
π’ Data Types
- int → whole numbers
- float → decimal numbers
- char → single character
- double → large decimal values
---
π€ Variables
Variables store data.
int a = 10;
float b = 5.5;
char ch = 'A';
---
π¨️ Input & Output
printf("Enter number:");
scanf("%d", &a);
π "printf()" = output
π "scanf()" = input
---
π Operators
Arithmetic
"+ - * / %"
Relational
"> < == !="
Logical
"&& || !"
---
π Conditional Statements
if(a > 0) {
printf("Positive");
} else {
printf("Negative");
}
π Used for decision making
---
π Loops
For Loop
for(int i=0; i<5; i++) {
printf("%d", i);
}
While Loop
while(i < 5) {
printf("%d", i);
i++;
}
---
π§ Functions
int add(int a, int b) {
return a + b;
}
π Functions help reuse code
---
π¦ Arrays
int arr[3] = {1,2,3};
π Store multiple values
---
π Important Tips
- Always use ";"
- Write clean code
- Practice daily
---
π’ Also Read
- HTML Notes
- CSS Notes
- JavaScript Notes
- Python Notes
---
π Conclusion
These were easy and detailed C programming notes.
Practice regularly to improve your coding skills π
π If helpful, save and share π
Comments
Post a Comment