C Programming Language || Hands On Coding
Hands-on C programming language challenges for beginners. Learn building logic by solving programs. Owner: @Pradeep_saii
Ko'proq ko'rsatish📈 Telegram kanali C Programming Language || Hands On Coding analitikasi
C Programming Language || Hands On Coding (@c_programming_language_coding) Ingliz til segmentidagi kanali faol ishtirokchi. Hozirda hamjamiyat 12 822 obunachidan iborat bo'lib, Texnologiyalar & Aralashmalar toifasida 9 562-o'rinni va Hindiston mintaqasida 31 207-o'rinni egallagan.
📊 Auditoriya ko‘rsatkichlari va dinamika
невідомо sanasidan buyon loyiha tez o‘sib, 12 822 obunachiga ega bo‘ldi.
26 Avgust, 2026 dagi oxirgi ma’lumotlarga ko‘ra kanal barqaror faollikka ega. Oxirgi 30 kunda obunachilar soni -210 ga, so‘nggi 24 soatda esa -2 ga o‘zgardi va umumiy qamrov yuqori darajada qolmoqda.
- Tasdiqlash holati: Tasdiqlanmagan
- Jalb etish (ER): Auditoriya o‘rtacha 12.56% darajada jalb etiladi. Nashrdan keyingi dastlabki 24 soatda kontent odatda umumiy obunachilar sonining 2.42% ini tashkil etuvchi reaksiyalarni to‘playdi.
- Post qamrovi: Har bir post o‘rtacha 1 612 marta ko‘riladi; birinchi sutkada odatda 310 ta ko‘rish yig‘iladi.
- Reaksiyalar va o‘zaro ta’sir: Auditoriya faol: har bir postga o‘rtacha 4 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:
“Hands-on C programming language challenges for beginners. Learn building logic by solving programs.
Owner: @Pradeep_saii”
Yuqori yangilanish chastotasi (oxirgi ma’lumot 27 Avgust, 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 reverseNumber(int num) {
int reversed = 0;
while (num != 0) {
int remainder = num % 10;
reversed = reversed * 10 + remainder;
num /= 10;
}
return reversed;
}
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
int reversedNumberResult = reverseNumber(number);
printf("Reversed Number: %dn", reversedNumberResult);
return 0;
}
📤 Output:
Input: 12345 Output: Reversed Number: 54321 Input: 100 Output: Reversed Number: 1 Input: -123 Output: Reversed Number: -321 Input: 0 Output: Reversed Number: 0
#include <stdio.h>
void printFibonacci(int n) {
int first = 0, second = 1, next;
printf("Fibonacci Series: ");
for (int i = 0; i < n; i++) {
printf("%d ", first);
next = first + second;
first = second;
second = next;
}
printf("n");
}
int main() {
int num;
printf("Enter the number of terms for Fibonacci Series: ");
scanf("%d", &num);
printFibonacci(num);
return 0;
}
📤 Output:
Input: 10 Output: Enter the number of terms for Fibonacci Series: Fibonacci Series: 0 1 1 2 3 5 8 13 21 34
#include <stdio.h>
int findLCM(int a, int b) {
int max = (a > b) ? a : b;
while (1) {
if (max % a == 0 && max % b == 0) {
return max;
}
max++;
}
}
int main() {
int num1, num2, lcm;
printf("Enter two positive integers: ");
scanf("%d %d", &num1, &num2);
lcm = findLCM(num1, num2);
printf("LCM of %d and %d is %dn", num1, num2, lcm);
return 0;
}
📤 Output:
Input: 12 18 Output: Enter two positive integers: LCM of 12 and 18 is 36 Input: 5 7 Output: Enter two positive integers: LCM of 5 and 7 is 35 Input: 24 36 Output: Enter two positive integers: LCM of 24 and 36 is 72
#include <stdio.h>
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
int main() {
int num1, num2;
printf("Enter two integers: ");
scanf("%d %d", &num1, &num2);
int result = gcd(num1, num2);
printf("GCD of %d and %d is %dn", num1, num2, result);
return 0;
}
📤 Output:
Input: 48 18 Output: Enter two integers: GCD of 48 and 18 is 6 Input: 1071 462 Output: Enter two integers: GCD of 1071 and 462 is 21 Input: 12 18 Output: Enter two integers: GCD of 12 and 18 is 6 Input: 5 7 Output: Enter two integers: GCD of 5 and 7 is 1 Input: 25 15 Output: Enter two integers: GCD of 25 and 15 is 5
#include <stdio.h>
long long factorial(int n) {
long long fact = 1;
for (int i = 1; i <= n; i++) {
fact *= i;
}
return fact;
}
long long nPr(int n, int r) {
if (r > n) {
return 0;
}
return factorial(n) / factorial(n - r);
}
int main() {
int n, r;
printf("Enter the value of n: ");
scanf("%d", &n);
printf("Enter the value of r: ");
scanf("%d", &r);
long long result = nPr(n, r);
printf("nPr (%d, %d) = %lldn", n, r, result);
return 0;
}
📤 Output:
Input: 5 Input: 2 Output: nPr (5, 2) = 20 Input: 7 Input: 7 Output: nPr (7, 7) = 5040 Input: 10 Input: 3 Output: nPr (10, 3) = 720 Input: 4 Input: 5 Output: nPr (4, 5) = 0
#include <stdio.h>
int factorial(int n) {
int fact = 1;
for (int i = 1; i <= n; i++) {
fact *= i;
}
return fact;
}
int nCr(int n, int r) {
if (r < 0 || r > n) {
return 0;
}
return factorial(n) / (factorial(r) * factorial(n - r));
}
int main() {
int n, r;
printf("Enter the value of n: ");
scanf("%d", &n);
printf("Enter the value of r: ");
scanf("%d", &r);
printf("nCr(%d, %d) = %dn", n, r, nCr(n, r));
return 0;
}
📤 Output:
Input: 5 Input: 2 Output: nCr(5, 2) = 10 Input: 7 Input: 0 Output: nCr(7, 0) = 1 Input: 4 Input: 4 Output: nCr(4, 4) = 1 Input: 6 Input: 3 Output: nCr(6, 3) = 20 Input: 5 Input: -1 Output: nCr(5, -1) = 0 Input: 5 Input: 6 Output: nCr(5, 6) = 0
#include <stdio.h>
#include <math.h>
int isArmstrong(int num) {
int originalNum, remainder, n = 0;
double result = 0.0;
originalNum = num;
// Count number of digits
while (originalNum != 0) {
originalNum /= 10;
++n;
}
originalNum = num;
// Calculate sum of digits raised to the power n
while (originalNum != 0) {
remainder = originalNum % 10;
result += pow(remainder, n);
originalNum /= 10;
}
// Check if number is Armstrong
if ((int)result == num) {
return 1; // True
} else {
return 0; // False
}
}
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
if (isArmstrong(number)) {
printf("%d is an Armstrong number.n", number);
} else {
printf("%d is not an Armstrong number.n", number);
}
return 0;
}
📤 Output:
Input: 153 Output: 153 is an Armstrong number. Input: 120 Output: 120 is not an Armstrong number. Input: 370 Output: 370 is an Armstrong number. Input: 1634 Output: 1634 is an Armstrong number. Input: 123 Output: 123 is not an Armstrong number.
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int isPalindrome(char str[]) {
int left = 0;
int right = strlen(str) - 1;
while (left < right) {
if (str[left] != str[right]) {
return 0;
}
left++;
right--;
}
return 1;
}
int main() {
char inputString[100];
printf("Enter a string: ");
scanf("%s", inputString);
if (isPalindrome(inputString)) {
printf(""%s" is a palindrome.n", inputString);
} else {
printf(""%s" is not a palindrome.n", inputString);
}
return 0;
}
📤 Output:
Input: madam Output: "madam" is a palindrome. Input: hello Output: "hello" is not a palindrome. Input: A man a plan a canal Panama Output: "A" is not a palindrome.
#include <stdio.h>
int factorial(int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
int main() {
int num;
printf("Enter a non-negative integer: ");
scanf("%d", &num);
if (num < 0) {
printf("Factorial is not defined for negative numbers.n");
} else {
int result = factorial(num);
printf("Factorial of %d = %dn", num, result);
}
return 0;
}
📤 Output:
Input: 5 Output: Enter a non-negative integer: Factorial of 5 = 120 Input: 0 Output: Enter a non-negative integer: Factorial of 0 = 1 Input: -2 Output: Enter a non-negative integer: Factorial is not defined for negative numbers.
#include <stdio.h>
#include <stdbool.h>
bool isPrime(int n) {
if (n <= 1) return false;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) return false;
}
return true;
}
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (isPrime(num)) {
printf("%d is a prime number.n", num);
} else {
printf("%d is not a prime number.n", num);
}
return 0;
}
📤 Output:
Input: 7 Output: 7 is a prime number. Input: 12 Output: 12 is not a prime number. Input: 1 Output: 1 is not a prime number. Input: 0 Output: 0 is not a prime number. Input: -5 Output: -5 is not a prime number.
#include <stdio.h>
int main() {
int x = 0, y = 0;
char move;
do {
printf("Current position: (%d, %d)n", x, y);
printf("Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): ");
scanf(" %c", &move);
switch (move) {
case 'w':
y++;
break;
case 'a':
x--;
break;
case 's':
y--;
break;
case 'd':
x++;
break;
case 'q':
printf("Quitting the game.n");
break;
default:
printf("Invalid move. Try again.n");
}
} while (move != 'q');
return 0;
}
📤 Output:
Current position: (0, 0) Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): Input: w Output: Current position: (0, 1) Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): Input: a Output: Current position: (-1, 1) Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): Input: s Output: Current position: (-1, 0) Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): Input: d Output: Current position: (0, 0) Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): Input: x Output: Invalid move. Try again. Current position: (0, 0) Enter move (w/a/s/d - wasd keys for up/left/down/right, q to quit): Input: q Output: Quitting the game.
#include <stdio.h>
int main() {
int choice;
float temp, converted_temp;
do {
printf("Temperature Conversion Menu:n");
printf("1. Celsius to Fahrenheitn");
printf("2. Fahrenheit to Celsiusn");
printf("3. Exitn");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
printf("Enter temperature in Celsius: ");
scanf("%f", &temp);
converted_temp = (temp * 9 / 5) + 32;
printf("Temperature in Fahrenheit: %.2fn", converted_temp);
break;
case 2:
printf("Enter temperature in Fahrenheit: ");
scanf("%f", &temp);
converted_temp = (temp - 32) * 5 / 9;
printf("Temperature in Celsius: %.2fn", converted_temp);
break;
case 3:
printf("Exiting...n");
break;
default:
printf("Invalid choice. Please try again.n");
}
} while (choice != 3);
return 0;
}
📤 Output:
Temperature Conversion Menu: 1. Celsius to Fahrenheit 2. Fahrenheit to Celsius 3. Exit Enter your choice: Input: 1 Enter temperature in Celsius: Input: 25 Output: Temperature in Fahrenheit: 77.00 Temperature Conversion Menu: 1. Celsius to Fahrenheit 2. Fahrenheit to Celsius 3. Exit Enter your choice: Input: 2 Enter temperature in Fahrenheit: Input: 98.6 Output: Temperature in Celsius: 37.00 Temperature Conversion Menu: 1. Celsius to Fahrenheit 2. Fahrenheit to Celsius 3. Exit Enter your choice: Input: 3 Output: Exiting...
#include <stdio.h>
#include <stdlib.h>
int main() {
int option;
float balance = 1000.0;
float amount;
do {
printf("ATM Menu:n");
printf("1. Check Balancen");
printf("2. Depositn");
printf("3. Withdrawn");
printf("4. Exitn");
printf("Enter your option: ");
scanf("%d", &option);
switch (option) {
case 1:
printf("Your balance is: %.2fn", balance);
break;
case 2:
printf("Enter amount to deposit: ");
scanf("%f", &amount);
if (amount > 0) {
balance += amount;
printf("Deposit successful. New balance: %.2fn", balance);
} else {
printf("Invalid amount.n");
}
break;
case 3:
printf("Enter amount to withdraw: ");
scanf("%f", &amount);
if (amount > 0 && amount <= balance) {
balance -= amount;
printf("Withdrawal successful. New balance: %.2fn", balance);
} else {
printf("Insufficient funds or invalid amount.n");
}
break;
case 4:
printf("Exiting ATM. Thank you!n");
break;
default:
printf("Invalid option. Please try again.n");
}
} while (option != 4);
return 0;
}
📤 Output:
ATM Menu: 1. Check Balance 2. Deposit 3. Withdraw 4. Exit Enter your option: Input: 1 Output: Your balance is: 1000.00 ATM Menu: 1. Check Balance 2. Deposit 3. Withdraw 4. Exit Enter your option: Input: 2 Output: Enter amount to deposit: Input: 200 Output: Deposit successful. New balance: 1200.00 ATM Menu: 1. Check Balance 2. Deposit 3. Withdraw 4. Exit Enter your option: Input: 3 Output: Enter amount to withdraw: Input: 500 Output: Withdrawal successful. New balance: 700.00 ATM Menu: 1. Check Balance 2. Deposit 3. Withdraw 4. Exit Enter your option: Input: 3 Output: Enter amount to withdraw: Input: 800 Output: Insufficient funds or invalid amount. ATM Menu: 1. Check Balance 2. Deposit 3. Withdraw 4. Exit Enter your option: Input: 4 Output: Exiting ATM. Thank you!
#include <stdio.h>
#include <string.h>
int main() {
char password[50];
int isValid = 0;
do {
printf("Enter your password: ");
scanf("%s", password);
if (strlen(password) >= 8) {
isValid = 1;
printf("Password accepted!n");
} else {
printf("Password must be at least 8 characters long.n");
printf("Please try again.n");
}
} while (isValid == 0);
return 0;
}
📤 Output:
Input: pass Output: Password must be at least 8 characters long. Output: Please try again. Input: password123 Output: Password accepted!
#include <stdio.h>
int main() {
int number, sum = 0;
do {
printf("Enter a number (negative to stop): ");
scanf("%d", &number);
if (number >= 0) {
sum += number;
}
} while (number >= 0);
printf("Sum of positive numbers entered: %dn", sum);
return 0;
}
📤 Output:
Input: 10 Input: 5 Input: 2 Input: -1 Output: Sum of positive numbers entered: 17
#include <stdio.h>
int main() {
char answer;
do {
printf("Do you want to continue? (y/n): ");
scanf(" %c", &answer);
if (answer == 'y') {
printf("Continuing...n");
} else if (answer == 'n') {
printf("Exiting...n");
} else {
printf("Invalid input. Please enter 'y' or 'n'.n");
}
} while (answer != 'n');
return 0;
}
📤 Output:
Input: y Output: Do you want to continue? (y/n): Continuing... Input: z Output: Do you want to continue? (y/n): Invalid input. Please enter 'y' or 'n'. Input: Y Output: Do you want to continue? (y/n): Invalid input. Please enter 'y' or 'n'. Input: n Output: Do you want to continue? (y/n): Exiting...
#include <stdio.h>
int main() {
int number;
int lower_bound = 10;
int upper_bound = 20;
do {
printf("Enter a number between %d and %d: ", lower_bound, upper_bound);
scanf("%d", &number);
if (number < lower_bound || number > upper_bound) {
printf("Invalid input. Please enter a number within the specified range.n");
}
} while (number < lower_bound || number > upper_bound);
printf("You entered: %dn", number);
return 0;
}
📤 Output:
Input: 5 Output: Enter a number between 10 and 20: 5 Invalid input. Please enter a number within the specified range. Input: 25 Output: Enter a number between 10 and 20: 25 Invalid input. Please enter a number within the specified range. Input: 15 Output: Enter a number between 10 and 20: 15 You entered: 15
