en
Feedback
C Programming Codes

C Programming Codes

Open in Telegram

C Programming Codes || Quizzes || DSA Learn along with the community Any queries admin - @Pradeep_saii

Show more

πŸ“ˆ Analytical overview of Telegram channel C Programming Codes

Channel C Programming Codes (@c_programming_codes) in the English language segment is an active participant. Currently, the community unites 13 431 subscribers, ranking 9 534 in the Technologies & Applications category and 32 075 in the India region.

πŸ“Š Audience metrics and dynamics

Since its creation on Π½Π΅Π²Ρ–Π΄ΠΎΠΌΠΎ, the project has demonstrated rapid growth, gathering an audience of 13 431 subscribers.

According to the latest data from 11 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -239 over the last 30 days and by -9 over the last 24 hours, overall reach remains high.

  • Verification status: Not verified
  • Engagement rate (ER): The average audience engagement rate is 9.78%. Within the first 24 hours after publication, content typically collects N/A% reactions from the total number of subscribers.
  • Post reach: On average, each post receives 0 views. Within the first day, a publication typically gains 0 views.
  • Reactions and interaction: The audience actively supports content: the average number of reactions per post is 0.
  • Thematic interests: Content is focused on key topics such as input, string, scanf("%d, array, element.

πŸ“ Description and content policy

The author describes the resource as a platform for expressing subjective opinions:
β€œC Programming Codes || Quizzes || DSA Learn along with the community Any queries admin - @Pradeep_saii”

Thanks to the high frequency of updates (latest data received on 12 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.

13 431
Subscribers
-924 hours
-577 days
-23930 days
Posts Archive
πŸ’» Remove Duplicates from Array
#include <stdio.h>

int main() {
    int n;
    printf("Enter the number of elements: ");
    scanf("%d", &n);

    int arr[n];
    printf("Enter the elements:n");
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    int uniqueArr[n];
    int uniqueSize = 0;

    for (int i = 0; i < n; i++) {
        int isDuplicate = 0;
        for (int j = 0; j < uniqueSize; j++) {
            if (arr[i] == uniqueArr[j]) {
                isDuplicate = 1;
                break;
            }
        }
        if (!isDuplicate) {
            uniqueArr[uniqueSize] = arr[i];
            uniqueSize++;
        }
    }

    printf("Array with unique elements:n");
    for (int i = 0; i < uniqueSize; i++) {
        printf("%d ", uniqueArr[i]);
    }
    printf("n");

    return 0;
}
πŸ“€ Output:
Input: 5
Input: 1
Input: 2
Input: 2
Input: 3
Input: 4
Output: Enter the number of elements: Enter the elements:
Array with unique elements:
1 2 3 4
Input: 7
Input: 5
Input: 2
Input: 5
Input: 1
Input: 2
Input: 3
Input: 4
Output: Enter the number of elements: Enter the elements:
Array with unique elements:
5 2 1 3 4

πŸ’» Check if Array is Sorted
#include <stdio.h>
#include <stdbool.h>

int main() {
    int n;

    printf("Enter the size of the array: ");
    scanf("%d", &n);

    int arr[n];

    printf("Enter the elements of the array: ");
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    bool isSorted = true;
    for (int i = 0; i < n - 1; i++) {
        if (arr[i] > arr[i + 1]) {
            isSorted = false;
            break;
        }
    }

    if (isSorted) {
        printf("Array is sorted.n");
    } else {
        printf("Array is not sorted.n");
    }

    return 0;
}
πŸ“€ Output:
Input: 5
Input: 1 2 3 4 5
Output: Array is sorted.
Input: 5
Input: 5 4 3 2 1
Output: Array is not sorted.
Input: 4
Input: 1 2 4 3
Output: Array is not sorted.
Input: 3
Input: 1 1 1
Output: Array is sorted.
Input: 1
Input: 10
Output: Array is sorted.

πŸ’» Reverse an Array
#include <stdio.h>

int main() {
    int n, i, temp;

    printf("Enter the number of elements in the array: ");
    scanf("%d", &n);

    int arr[n];

    printf("Enter the elements of the array:n");
    for (i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    // Reversing the array
    for (i = 0; i < n / 2; i++) {
        temp = arr[i];
        arr[i] = arr[n - i - 1];
        arr[n - i - 1] = temp;
    }

    printf("Reversed array: ");
    for (i = 0; i < n; i++) {
        printf("%d ", arr[i]);
    }
    printf("n");

    return 0;
}
πŸ“€ Output:
Input: 5
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Output: Enter the number of elements in the array: Enter the elements of the array:
Reversed array: 5 4 3 2 1

Input: 6
Input: 10
Input: 20
Input: 30
Input: 40
Input: 50
Input: 60
Output: Enter the number of elements in the array: Enter the elements of the array:
Reversed array: 60 50 40 30 20 10

πŸ’» Average of Array Elements
#include <stdio.h>

int main() {
  int n, i;
  float sum = 0.0, average;

  printf("Enter the number of elements: ");
  scanf("%d", &n);

  float arr[n];

  printf("Enter the elements:n");
  for (i = 0; i < n; i++) {
    scanf("%f", &arr[i]);
    sum += arr[i];
  }

  average = sum / n;

  printf("Average = %.2fn", average);

  return 0;
}
πŸ“€ Output:
Input: 3
Input: 1.0
Input: 2.0
Input: 3.0
Output: Enter the number of elements: Enter the elements:
Average = 2.00

πŸ’» Sum of All Elements in Array
#include <stdio.h>

int main() {
    int n, i, sum = 0;

    printf("Enter the number of elements in the array: ");
    scanf("%d", &n);

    int arr[n];

    printf("Enter the elements of the array:n");
    for (i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    for (i = 0; i < n; i++) {
        sum += arr[i];
    }

    printf("Sum of all elements in the array = %dn", sum);

    return 0;
}
πŸ“€ Output:
Input: 5
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Output: Enter the number of elements in the array: Enter the elements of the array:
Sum of all elements in the array = 15

πŸ’» Find Smallest Element in an Array
#include <stdio.h>

int main() {
  int arr[5];
  int smallest;
  int i;

  printf("Enter 5 integer elements:n");
  for (i = 0; i < 5; i++) {
    scanf("%d", &arr[i]);
  }

  smallest = arr[0];

  for (i = 1; i < 5; i++) {
    if (arr[i] < smallest) {
      smallest = arr[i];
    }
  }

  printf("Smallest element: %dn", smallest);

  return 0;
}
πŸ“€ Output:
Input: 5
Input: 2
Input: 8
Input: 1
Input: 9
Output: Enter 5 integer elements:
Output: Smallest element: 1

πŸ’» Find Largest Element in an Array
#include <stdio.h>

int main() {
    int n;
    printf("Enter the number of elements in the array: ");
    scanf("%d", &n);

    int arr[n];
    printf("Enter the elements of the array:n");
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    int largest = arr[0];
    for (int i = 1; i < n; i++) {
        if (arr[i] > largest) {
            largest = arr[i];
        }
    }

    printf("The largest element in the array is: %dn", largest);

    return 0;
}
πŸ“€ Output:
Input: 5
Input: 12
Input: 5
Input: 28
Input: 3
Input: 19
Output: Enter the number of elements in the array: Enter the elements of the array:
The largest element in the array is: 28

πŸ”§ Arrays - 1D

πŸ’» Recursive Function to Find Sum of Natural Numbers
#include <stdio.h>

int sum_natural(int n) {
    if (n == 0) {
        return 0;
    } else {
        return n + sum_natural(n - 1);
    }
}

int main() {
    int num;

    printf("Enter a positive integer: ");
    scanf("%d", &num);

    if (num < 0) {
        printf("Please enter a non-negative integer.n");
    } else {
        int sum = sum_natural(num);
        printf("Sum of natural numbers up to %d = %dn", num, sum);
    }

    return 0;
}
πŸ“€ Output:
Input: 5
Output: Enter a positive integer: Sum of natural numbers up to 5 = 15

Input: 0
Output: Enter a positive integer: Sum of natural numbers up to 0 = 0

Input: -3
Output: Enter a positive integer: Please enter a non-negative integer.

πŸ’» Function with Call by Reference
#include <stdio.h>

void increment(int *n) {
  *n = *n + 1;
}

int main() {
  int num = 10;
  printf("Before increment: %dn", num);
  increment(&num);
  printf("After increment: %dn", num);
  return 0;
}
πŸ“€ Output:
Before increment: 10
After increment: 11

πŸ’» Function with Call by Value
#include <stdio.h>

void modifyValue(int x) {
  x = x + 10;
  printf("Value inside function: %dn", x);
}

int main() {
  int num;

  printf("Enter an integer: ");
  scanf("%d", &num);

  printf("Value before function call: %dn", num);
  modifyValue(num);
  printf("Value after function call: %dn", num);

  return 0;
}
πŸ“€ Output:
Input: 5
Output: Enter an integer: Value before function call: 5
Value inside function: 15
Value after function call: 5

πŸ’» Function to Check Strong Number
#include <stdio.h>

int factorial(int n) {
    int fact = 1;
    for (int i = 1; i <= n; i++) {
        fact *= i;
    }
    return fact;
}

int isStrong(int num) {
    int originalNum = num;
    int sum = 0;
    while (num > 0) {
        int digit = num % 10;
        sum += factorial(digit);
        num /= 10;
    }
    if (sum == originalNum) {
        return 1;
    } else {
        return 0;
    }
}

int main() {
    int number;
    printf("Enter a number: ");
    scanf("%d", &number);

    if (isStrong(number)) {
        printf("%d is a strong number.n", number);
    } else {
        printf("%d is not a strong number.n", number);
    }

    return 0;
}
πŸ“€ Output:
Input: 145
Output: 145 is a strong number.

Input: 123
Output: 123 is not a strong number.

Input: 40585
Output: 40585 is a strong number.

πŸ’» Function to Check Perfect Number
#include <stdio.h>

int isPerfect(int num) {
    int sum = 1;
    for (int i = 2; i * i <= num; i++) {
        if (num % i == 0) {
            if (i * i != num)
                sum = sum + i + num / i;
            else
                sum = sum + i;
        }
    }
    if (sum == num && num != 1)
        return 1; // True
    else
        return 0; // False
}

int main() {
    int number;
    printf("Enter a number: ");
    scanf("%d", &number);

    if (isPerfect(number)) {
        printf("%d is a perfect numbern", number);
    } else {
        printf("%d is not a perfect numbern", number);
    }

    return 0;
}
πŸ“€ Output:
Input: 6
Output: 6 is a perfect number

Input: 28
Output: 28 is a perfect number

Input: 12
Output: 12 is not a perfect number

Input: 496
Output: 496 is a perfect number

Input: 8128
Output: 8128 is a perfect number

Input: 1
Output: 1 is not a perfect number

Input: 0
Output: 0 is not a perfect number

Input: -1
Output: -1 is not a perfect number

πŸ’» Function to Convert Binary to Decimal
#include <stdio.h>
#include <math.h>

int binaryToDecimal(long long n) {
    int decimalNumber = 0, i = 0, remainder;
    while (n!=0) {
        remainder = n % 10;
        n /= 10;
        decimalNumber += remainder * pow(2, i);
        ++i;
    }
    return decimalNumber;
}

int main() {
    long long n;
    printf("Enter a binary number: ");
    scanf("%lld", &n);
    printf("Decimal equivalent: %d", binaryToDecimal(n));
    return 0;
}
πŸ“€ Output:
Input: 101101
Output: Decimal equivalent: 45
Input: 1111
Output: Decimal equivalent: 15
Input: 0
Output: Decimal equivalent: 0
Input: 10000000
Output: Decimal equivalent: 128
Input: 1
Output: Decimal equivalent: 1

πŸ’» Function to Convert Decimal to Binary
#include <stdio.h>
#include <stdlib.h>

void decimalToBinary(int n) {
  if (n > 0) {
    decimalToBinary(n / 2);
    printf("%d", n % 2);
  }
}

int main() {
  int decimal;

  printf("Enter a decimal number: ");
  scanf("%d", &decimal);

  printf("Binary equivalent: ");
  if(decimal == 0){
      printf("0");
  } else {
      decimalToBinary(decimal);
  }
  printf("n");

  return 0;
}
πŸ“€ Output:
Input: 10
Output: Enter a decimal number: Binary equivalent: 1010
Input: 0
Output: Enter a decimal number: Binary equivalent: 0
Input: 25
Output: Enter a decimal number: Binary equivalent: 11001
Input: 128
Output: Enter a decimal number: Binary equivalent: 10000000
Input: 1
Output: Enter a decimal number: Binary equivalent: 1

πŸ’» Function to Calculate Sum of Digits
#include <stdio.h>

int sumOfDigits(int num) {
    int sum = 0;
    while (num != 0) {
        sum += num % 10;
        num /= 10;
    }
    return sum;
}

int main() {
    int number;
    printf("Enter a positive integer: ");
    scanf("%d", &number);

    if (number < 0) {
        printf("Please enter a positive integer.n");
        return 1;
    }

    int sum = sumOfDigits(number);
    printf("Sum of digits of %d is %dn", number, sum);

    return 0;
}
πŸ“€ Output:
Input: 12345
Output: Enter a positive integer: Sum of digits of 12345 is 15

Input: 5
Output: Enter a positive integer: Sum of digits of 5 is 5

Input: 999
Output: Enter a positive integer: Sum of digits of 999 is 27

Input: -10
Output: Enter a positive integer: Please enter a positive integer.

πŸ”₯ The first structured DSA channel on Telegram is here! Solve LeetCode problems consistently with a plan that actually works
πŸ”₯ The first structured DSA channel on Telegram is here! Solve LeetCode problems consistently with a plan that actually works. Join now: πŸ”— https://t.me/+utZsK17rSXRmZWQ1 🎯 No distractions. Just focused growth with a supportive community.

πŸ’» Function to Reverse a Number
#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

πŸ’» Function to Print Fibonacci Series
#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

πŸ”₯ The first structured DSA channel on Telegram is here! Solve LeetCode problems consistently with a plan that actually works
πŸ”₯ The first structured DSA channel on Telegram is here! Solve LeetCode problems consistently with a plan that actually works. Join now: πŸ”— https://t.me/+utZsK17rSXRmZWQ1 🎯 No distractions. Just focused growth with a supportive community.