C Programming Codes
C Programming Codes || Quizzes || DSA Learn along with the community Any queries admin - @Pradeep_saii
Ko'proq ko'rsatish📈 Telegram kanali C Programming Codes analitikasi
C Programming Codes (@c_programming_codes) Ingliz til segmentidagi kanali faol ishtirokchi. Hozirda hamjamiyat 13 420 obunachidan iborat bo'lib, Texnologiyalar & Aralashmalar toifasida 9 537-o'rinni va Hindiston mintaqasida 32 062-o'rinni egallagan.
📊 Auditoriya ko‘rsatkichlari va dinamika
невідомо sanasidan buyon loyiha tez o‘sib, 13 420 obunachiga ega bo‘ldi.
12 Iyun, 2026 dagi oxirgi ma’lumotlarga ko‘ra kanal barqaror faollikka ega. Oxirgi 30 kunda obunachilar soni -240 ga, so‘nggi 24 soatda esa -9 ga o‘zgardi va umumiy qamrov yuqori darajada qolmoqda.
- Tasdiqlash holati: Tasdiqlanmagan
- Jalb etish (ER): Auditoriya o‘rtacha 9.78% darajada jalb etiladi. Nashrdan keyingi dastlabki 24 soatda kontent odatda umumiy obunachilar sonining N/A% ini tashkil etuvchi reaksiyalarni to‘playdi.
- Post qamrovi: Har bir post o‘rtacha 0 marta ko‘riladi; birinchi sutkada odatda 0 ta ko‘rish yig‘iladi.
- Reaksiyalar va o‘zaro ta’sir: Auditoriya faol: har bir postga o‘rtacha 0 ta reaksiya keladi.
- Tematik yo‘nalishlar: Kontent input, string, scanf("%d, array, element kabi asosiy mavzularga jamlangan.
📝 Tavsif va kontent siyosati
Muallif resursni shaxsiy fikrni ifoda etish maydoni sifatida ta’riflaydi:
“C Programming Codes || Quizzes || DSA
Learn along with the community
Any queries
admin - @Pradeep_saii”
Yuqori yangilanish chastotasi (oxirgi ma’lumot 13 Iyun, 2026 da olingan) sababli kanal doimo dolzarb va katta qamrovli bo‘lib qoladi. Analitika auditoriya kontent bilan faol hamkorlik qilishini, uni Texnologiyalar & Aralashmalar toifasidagi muhim ta’sir nuqtasiga aylantirishini ko‘rsatadi.
#include <stdio.h>
int factorial(int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
int main() {
int num = 5;
int result = factorial(num);
printf("Factorial of %d = %d\n", num, result);
return 0;
}#include <stdio.h>
int square(int n) {
return n * n;
}
int main() {
int num = 5;
int result = square(num);
printf("Square of %d is %d\n", num, result);
return 0;
}#include <stdio.h>
void printMessage() {
printf("Hello from the helper function!\n");
}
int main() {
printMessage();
return 0;
}#include <stdio.h>
int isEven(int num) {
if (num % 2 == 0) {
return 1;
} else {
return 0;
}
}
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
if (isEven(number)) {
printf("%d is even.\n", number);
} else {
printf("%d is odd.\n", number);
}
return 0;
}#include <stdio.h>
int findMax(int num1, int num2) {
if (num1 > num2) {
return num1;
}
return num2;
}
int main() {
int a, b, max;
scanf("%d %d", &a, &b);
max = findMax(a, b);
printf("%d", max);
return 0;
}#include <stdio.h>
int add(int a, int b) {
return a + b;
}
int main() {
int num1 = 10;
int num2 = 5;
int sum = add(num1, num2);
printf("Sum: %d\n", sum);
return 0;
}#include <stdio.h>
#include <time.h>
int getCurrentYear() {
time_t timer;
struct tm* tm_info;
time(&timer);
tm_info = localtime(&timer);
return tm_info->tm_year + 1900;
}
int main() {
int year = getCurrentYear();
printf("Current year: %d\n", year);
return 0;
}#include <stdio.h>
int get_value() {
return 100;
}
int main() {
int result = get_value();
printf("%d\n", result);
return 0;
}#include <stdio.h>
void checkNumber(int num) {
if (num > 0) {
printf("Positive\n");
} else if (num < 0) {
printf("Negative\n");
} else {
printf("Zero\n");
}
}
int main() {
int number;
scanf("%d", &number);
checkNumber(number);
return 0;
}#include <stdio.h>
void printInfo(char name[], int age) {
printf("Name: %s\n", name);
printf("Age: %d\n", age);
}
int main() {
char myName[] = "Alice";
int myAge = 30;
printInfo(myName, myAge);
return 0;
}#include <stdio.h>
void welcomeMessage() {
printf("Welcome to C programming!\n");
}
int main() {
welcomeMessage();
return 0;
}#include <stdio.h>
void printHelloWorld() {
printf("Hello, World!\n");
}
int main() {
printHelloWorld();
return 0;
}
#include <stdio.h>
void printHello() {
printf("Hello, world!n");
}
int main() {
printHello(); // Calling or invoking the function
return 0;
}
- `void printHello()`: This declares a function named `printHello`.
- `void`: This means the function doesn't return any value. It just does something (in this case, printing).
- `printHello()`: This is the name of the function. Choose descriptive names!
- `{}`: The curly braces contain the code that the function executes.
- `printf("Hello, world!\n");`: This line prints "Hello, world!" to the console. `\n` adds a newline character (moves the cursor to the next line).
- `main()`: This is the main function, where the program execution begins.
- `printHello();`: This *calls* or *invokes* the `printHello` function. When the program reaches this line, it jumps to the `printHello` function, executes its code, and then returns to the next line in `main()`.
**2. Functions with Return Types (Giving Back Results)** ↩️
Sometimes, you want a function to calculate something and give you the result. This is where return types come in.
#include <stdio.h>
int add(int a, int b) {
int sum = a + b;
return sum;
}
int main() {
int result = add(5, 3);
printf("The sum is: %dn", result);
return 0;
}
- `int add(int a, int b)`:
- `int`: This is the *return type*. It means the function will return an integer value.
- `a` and `b`: These are *parameters*. They're like inputs to the function. `a` and `b` are integers.
- `return sum;`: This statement sends the value of `sum` back to the calling function (`main()`).
- `int result = add(5, 3);`: In `main()`, we call the `add` function with the values 5 and 3. The returned value (8) is then stored in the `result` variable.
**3. Parameters (Passing Information to Functions)** ➡️
Parameters are variables that you pass into a function. They allow you to give functions different inputs each time you call them.
#include <stdio.h>
void greet(char name[]) {
printf("Hello, %s!n", name);
}
int main() {
greet("Alice");
greet("Bob");
return 0;
}
- `char name[]`: This declares a parameter named `name` which is an array of characters (a string). The function takes a string as input.
- `greet("Alice")`: When we call `greet("Alice")`, the string "Alice" is passed as the value of the `name` parameter.
**4. Recursion (Functions Calling Themselves)** 🔄
Recursion is a powerful technique where a function calls *itself*. It's like looking in a mirror that reflects another mirror, and so on. 🤯 You need a "base case" to stop the recursion, or it will go on forever (or until your program crashes!).
#include <stdio.h>
int factorial(int n) {
// Base case:
if (n == 0) {
return 1;
}
// Recursive step:
else {
return n * factorial(n - 1);
}
}
int main() {
int result = factorial(5);
printf("Factorial of 5 is: %dn", result);
return 0;
}
- `factorial(int n)`: This function calculates the factorial of a number `n`.
- Base Case: `if (n == 0) { return 1; }`: The factorial of 0 is 1. This is the base case that stops the recursion. ⚠️ Without a base case, the function would call itself infinitely!
- Recursive Step#include <stdio.h>
int main() {
int i = 8;
int count = 0;
for (; i; i >>= 1) {
printf("%d ", i);
count++;
}
printf("\nLoop ran %d times.\n", count);
return 0;
}#include <stdio.h>
int main() {
for (int i = 1; i <= 10; i++) {
if (i == 5 || i == 7) {
continue;
}
printf("%d ", i);
}
printf("\n");
return 0;
}#include <stdio.h>
int main() {
int i = 0;
while (1) {
printf("%d ", i);
i++;
if (i > 9) {
break;
}
}
printf("\nLoop finished!\n");
return 0;
}#include <stdio.h>
int main() {
char ch;
for (ch = 'A'; ch <= 'Z'; ch++) {
printf("%c", ch);
if (ch < 'Z') {
printf("-");
}
}
printf("\n");
return 0;
}#include <stdio.h>
int main() {
int rows, num = 1;
scanf("%d", &rows);
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
printf("%d ", num++);
}
printf("\n");
}
return 0;
}
Endi mavjud! Telegram Tadqiqoti 2025 — yilning asosiy insaytlari 
