C Introduction
C is a general-purpose, procedural programming language, developed in the early 1970s by Dennis Ritchie at Bell Labs.
यह एक low-level और high-level दोनों तरह की विशेषताएं रखने वाली middle-level language है।
It is widely used for:
[i] System programming (जैसे कि operating systems बनाना)
[ii] Embedded systems
[iii] Game development
[iv] Compiler creation
Why Learn C ?
1 Foundation of Programming –
C लगभग सभी modern languages जैसे C++, Java, Python की base language है।
2 Speed and Performance –
C programs fast होते हैं, इसलिए high-performance applications में use किया जाता है।
3 Control over System –
Pointers, memory management जैसे features से C gives direct control over hardware (RAM, CPU access etc.)
4 Use in Interviews –
बहुत सी companies interviews में C के concepts पूछती हैं जैसे pointers, arrays, structures।
5 Portability –
C से लिखा गया code अलग-अलग systems में run कर सकता है with minimal changes।
C program- Hello World
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
यह basic structure, C program का है ।
Explanation :
1- #include <stdio.h> – ये preprocessor directive है, जो standard input/output library को include करता है।
2- int main() – main function से program की शुरुआत होती है।
3- printf() – output दिखाने के लिए function है।
4- return 0; – program का successful execution दिखाता है।
C Output
Output दिखाने के लिए हम printf() function का उपयोग करते हैं।
printf("Welcome to C Programming!");
printf("Welcome to Quick Learn Code! ");
C New Lines
नई लाइन के लिए हम \n escape sequence use करते हैं।
printf("Hello\nWorld");
printf("Welcome to \n Quick Learn Code! ");
Output:
Welcome to
Quick Learn Code!
C Comments
Comments वो हिस्से होते हैं जो code को explain करते हैं लेकिन execute नहीं होते।
Types of Comments:
1- Single-line comment:
// ये एक comment है
2- Multi-line comment:
/*
ये एक
multi-line comment है
*/
Comments से code की readability बढ़ती है और दूसरों को समझने में आसानी होती है।
Important Questions
1. Who developed C Language?
Dennis Ritchie ने 1972 में Bell Labs में इसे बनाया।
2. What is the extension of C file?
.c (Example: program.c)
3. Is C compiled or interpreted?
C is a compiled language. इसका मतलब है कि C code को पहले machine language में translate किया जाता है using a compiler.
4. What is a compiler?
Compiler एक program है जो C code को machine language में convert करता है ताकि computer उसे समझ सके।
Comments
Post a Comment