- Procedural programming language
- Fast and efficient
- Middle-level language
- Supports pointers and structured programming
- Portable and widely used for system/software development
- प्रक्रियात्मक प्रोग्रामिंग भाषा
- तेज़ और कुशल
- मध्य-स्तरीय भाषा
- पॉइंटर्स और संरचित प्रोग्रामिंग का समर्थन करता है
- पोर्टेबल और सिस्टम/सॉफ्टवेयर विकास के लिए व्यापक रूप से उपयोग किया जाता है
A typical C program contains:
- Header files inclusion
- The main() function
- Variable declarations
- Logic and statements
- Return statement
Example:
#include <stdio.h>
int main() {
// code here
return 0;
}
एक सामान्य C प्रोग्राम में होता है:
- हेडर फाइल्स शामिल करना
- main() फ़ंक्शन
- वेरिएबल घोषणा
- लॉजिक और स्टेटमेंट
- रिटर्न स्टेटमेंट
उदाहरण:
#include <stdio.h>
int main() {
// कोड यहाँ
return 0;
}
The main() function is the entry point of a C program where execution begins. It returns an integer value to the operating system, usually 0 indicating success. main() फ़ंक्शन C प्रोग्राम का प्रवेश बिंदु होता है जहाँ से प्रोग्राम का कार्य प्रारंभ होता है। यह ऑपरेटिंग सिस्टम को एक पूर्णांक मान लौटाता है, आमतौर पर 0 जो सफलता दर्शाता है।
Keywords are reserved words in C with special meaning (like int, return). Identifiers are names created by the programmer for variables, functions, etc., and cannot be keywords. कीवर्ड्स C के आरक्षित शब्द होते हैं जिनका विशेष अर्थ होता है (जैसे int, return)। आइडेंटिफायर्स प्रोग्रामर द्वारा बनाए गए नाम होते हैं जैसे वेरिएबल या फ़ंक्शन के लिए, और ये कीवर्ड्स नहीं हो सकते।
#include <filename> is used to include system header files searched in standard directories.
#include "filename" is used to include user-defined header files searched in current directory first.
#include <filename> का उपयोग सिस्टम हेडर फाइल्स को शामिल करने के लिए किया जाता है, जो मानक डायरेक्टरीज में खोजी जाती हैं।
#include "filename" का उपयोग यूजर-डिफाइंड हेडर फाइल्स को शामिल करने के लिए किया जाता है, जो सबसे पहले वर्तमान डायरेक्टरी में खोजी जाती हैं।
Data types specify the type and size of data that variables can hold. Common types: int, char, float, double. डेटा टाइप्स यह निर्दिष्ट करते हैं कि वेरिएबल किस प्रकार और आकार का डेटा रख सकता है। सामान्य प्रकार: int, char, float, double।
Signed int can store both positive and negative integers.
Unsigned int stores only positive integers (including zero).
Signed int सकारात्मक और नकारात्मक दोनों पूर्णांक रख सकता है।
Unsigned int केवल सकारात्मक पूर्णांक (शून्य सहित) रखता है।
Typically:
int = 4 bytes
char = 1 byte
float = 4 bytes
double = 8 bytes
(May vary with compiler and system)
सामान्यतः:
int = 4 बाइट
char = 1 बाइट
float = 4 बाइट
double = 8 बाइट
(कंपाइलर और सिस्टम के अनुसार बदल सकता है)
Declaration tells compiler about the variable's type and name.
Initialization assigns an initial value to the variable.
डिक्लेरेशन कंपाइलर को वेरिएबल के प्रकार और नाम के बारे में बताता है।
इनिशियलाइज़ेशन वेरिएबल को प्रारंभिक मान देता है।
Storage classes specify the scope, lifetime, and visibility of variables.
Types: auto, extern, static, register.
Storage classes वेरिएबल की स्कोप, जीवनकाल, और दृश्यता निर्धारित करते हैं।
प्रकार: auto, extern, static, register।