C Basics
Understanding Basic Concepts of C Programming
Introduction to C (सी भाषा का परिचय)
C एक general-purpose programming language है जिसे 1972 में Dennis Ritchie ने develop किया था। यह structured programming का support करता है और system programming के लिए widely used है।
C is a general-purpose programming language developed by Dennis Ritchie in 1972. It supports structured programming and is widely used for system programming.
Key Features (मुख्य विशेषताएं):
- C एक procedural language है
- C is a procedural language
- C low-level memory access provide करता है
- C provides low-level memory access
- C simple और efficient है
- C is simple and efficient
- C portable और flexible है
- C is portable and flexible
Basic Structure (मूल संरचना)
C program की basic structure:
Basic structure of a C program:
#include <stdio.h> // Header file inclusion
int main() { // Main function
printf("Hello, World!\n"); // Print statement
return 0; // Return statement
}
Component (कंपोनेंट) | Description (विवरण) |
---|---|
Header Files | Standard library functions को include करते हैं |
Header Files | Include standard library functions |
Main Function | Program execution का starting point है |
Main Function | Starting point of program execution |
Statements | Instructions जो program execute करता है |
Statements | Instructions that program executes |
Variables and Constants (चर और स्थिरांक)
Variables और Constants का उपयोग:
Usage of Variables and Constants:
// Variable declaration and initialization
int age = 25; // Integer variable
float pi = 3.14; // Floating point variable
char grade = 'A'; // Character variable
// Constant declaration
const int MAX_VALUE = 100; // Integer constant
const float PI = 3.14159; // Floating point constant
Input and Output (इनपुट और आउटपुट)
Basic input/output operations:
Basic input/output operations:
#include <stdio.h>
int main() {
int number;
// Input
printf("Enter a number: ");
scanf("%d", &number);
// Output
printf("You entered: %d\n", number);
return 0;
}
Best Practices (सर्वोत्तम प्रथाएं)
C programming के साथ काम करने के best practices:
Best practices for working with C programming: