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
πŸ’» Count Words in a String
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char str[100];
    int count = 0;
    int i;

    printf("Enter a string: ");
    fgets(str, sizeof(str), stdin);

    // Remove trailing newline character
    if (str[strlen(str) - 1] == 'n') {
        str[strlen(str) - 1] = '0';
    }

    if (strlen(str) > 0) {
        count = 1;
    }

    for (i = 0; str[i] != '0'; i++) {
        if (str[i] == ' ' && isspace(str[i])) {
            count++;
        }
    }

    printf("Number of words: %dn", count);

    return 0;
}
πŸ“€ Output:
Input: Hello World
Output: Number of words: 2
Input: This is a test string.
Output: Number of words: 5
Input:  Leading space
Output: Number of words: 2
Input: Trailing space
Output: Number of words: 2
Input: Multiple   spaces
Output: Number of words: 3
Input:
Output: Number of words: 0
Input: One
Output: Number of words: 1

πŸ’» Convert String to Lowercase
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char str[100];
    int i;

    printf("Enter a string: ");
    scanf("%[^n]", str);

    for (i = 0; str[i] != '0'; i++) {
        str[i] = tolower(str[i]);
    }

    printf("Lowercase string: %sn", str);

    return 0;
}
πŸ“€ Output:
Input: HeLlO wOrLd!
Output: Enter a string: Lowercase string: hello world!
Input: MiXeD cAsE sTrInG
Output: Enter a string: Lowercase string: mixed case string
Input: 123 AbCd
Output: Enter a string: Lowercase string: 123 abcd
Input: THIS IS ALL CAPS
Output: Enter a string: Lowercase string: this is all caps
Input: aBcDeFgHiJkLmNoPqRsTuVwXyZ
Output: Enter a string: Lowercase string: abcdefghijklmnopqrstuvwxyz

πŸ’» Convert String to Uppercase
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char str[100];
    int i;

    printf("Enter a string: ");
    scanf("%[^n]", str);

    for (i = 0; str[i] != '0'; i++) {
        str[i] = toupper(str[i]);
    }

    printf("Uppercase string: %sn", str);

    return 0;
}
πŸ“€ Output:
Input: hello world
Output: Enter a string: Uppercase string: HELLO WORLD

Input: MiXeD CaSe StRiNg
Output: Enter a string: Uppercase string: MIXED CASE STRING

Input: 123 abc
Output: Enter a string: Uppercase string: 123 ABC

πŸ’» Compare Two Strings
#include <stdio.h>
#include <string.h>

int main() {
  char str1[100], str2[100];

  printf("Enter the first string: ");
  scanf("%s", str1);

  printf("Enter the second string: ");
  scanf("%s", str2);

  int result = strcmp(str1, str2);

  if (result == 0) {
    printf("The strings are equal.n");
  } else if (result < 0) {
    printf("The first string is less than the second string.n");
  } else {
    printf("The first string is greater than the second string.n");
  }

  return 0;
}
πŸ“€ Output:
Input: apple
Input: apple
Output: The strings are equal.

Input: apple
Input: banana
Output: The first string is less than the second string.

Input: banana
Input: apple
Output: The first string is greater than the second string.

Input: Hello
Input: hello
Output: The first string is less than the second string.

Input: 123
Input: 1234
Output: The first string is less than the second string.

πŸ’» Concatenate Two Strings
#include <stdio.h>
#include <string.h>

int main() {
    char str1[100], str2[100];

    printf("Enter the first string: ");
    scanf("%s", str1);

    printf("Enter the second string: ");
    scanf("%s", str2);

    strcat(str1, str2);

    printf("Concatenated string: %sn", str1);

    return 0;
}
πŸ“€ Output:
Input: Hello
Input: World
Output: Concatenated string: HelloWorld

πŸ’» Copy One String to Another
#include <stdio.h>
#include <string.h>

int main() {
    char str1[100];
    char str2[100];
    int i;

    printf("Enter a string: ");
    scanf("%99s", str1);

    for (i = 0; str1[i] != '0'; i++) {
        str2[i] = str1[i];
    }
    str2[i] = '0';

    printf("Original string: %sn", str1);
    printf("Copied string: %sn", str2);

    return 0;
}
πŸ“€ Output:
Input: Hello, World!
Output: Enter a string: Original string: Hello,
Output: Copied string: Hello,

πŸ’» Reverse a String
#include <stdio.h>
#include <string.h>

int main() {
  char str[100];
  int i, len;

  printf("Enter a string: ");
  scanf("%s", str);

  len = strlen(str);

  printf("Reversed string: ");
  for (i = len - 1; i >= 0; i--) {
    printf("%c", str[i]);
  }
  printf("n");

  return 0;
}
πŸ“€ Output:
Input: Hello
Output: Enter a string: Reversed string: olleH
Input: Cprogramming
Output: Enter a string: Reversed string: gnimmargorpC
Input: 12345
Output: Enter a string: Reversed string: 54321
Input: A
Output: Enter a string: Reversed string: A
Input:
Output: Enter a string: Reversed string:

πŸ’» Check if String is Palindrome
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char str[100];
    int i, len, isPalindrome = 1;

    printf("Enter a string: ");
    scanf("%s", str);

    len = strlen(str);

    for (i = 0; i < len / 2; i++) {
        if (tolower(str[i]) != tolower(str[len - i - 1])) {
            isPalindrome = 0;
            break;
        }
    }

    if (isPalindrome) {
        printf("%s is a palindromen", str);
    } else {
        printf("%s is not a palindromen", str);
    }

    return 0;
}
πŸ“€ Output:
Input: madam
Output: madam is a palindrome
Input: racecar
Output: racecar 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
Input: WasItACarOrACatISaw
Output: WasItACarOrACatISaw is not a palindrome
Input: level
Output: level is a palindrome
Input: rotor
Output: rotor is a palindrome
Input: stats
Output: stats is a palindrome
Input: kayak
Output: kayak is a palindrome
Input: refer
Output: refer is a palindrome

πŸ’» Count Digits and Special Characters in String
#include <stdio.h>
#include <string.h>

int main() {
  char str[100];
  int digits = 0, special = 0;
  int i;

  printf("Enter a string: ");
  scanf("%[^n]", str);

  for (i = 0; str[i] != '0'; i++) {
    if (str[i] >= '0' && str[i] <= '9') {
      digits++;
    } else if ((str[i] >= '!' && str[i] <= '/') || (str[i] >= ':' && str[i] <= '@') ||
               (str[i] >= '[' && str[i] <= ''') || (str[i] >= '{' && str[i] <= '~')) {
      special++;
    }
  }

  printf("Digits: %dn", digits);
  printf("Special characters: %dn", special);

  return 0;
}
πŸ“€ Output:
Input: Hello123!@#
Output: Digits: 3
Output: Special characters: 3
Input: abcDEF456$%^
Output: Digits: 3
Output: Special characters: 3
Input: 12345
Output: Digits: 5
Output: Special characters: 0
Input: Special!@#$%^&*()
Output: Digits: 0
Output: Special characters: 10
Input: mixedCase123.,;'[]{}
Output: Digits: 3
Output: Special characters: 9
Input: Just a normal string
Output: Digits: 0
Output: Special characters: 0
Input: This string has numbers and symbols: 123!@#
Output: Digits: 3
Output: Special characters: 3
Input: ""
Output: Digits: 0
Output: Special characters: 0
Input:   123~!@#
Output: Digits: 3
Output: Special characters: 3

πŸ’» Count Vowels and Consonants in a String
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char str[100];
    int vowels = 0, consonants = 0;
    int i;

    printf("Enter a string: ");
    fgets(str, sizeof(str), stdin);

    // Remove trailing newline character
    str[strcspn(str, "n")] = 0;

    for (i = 0; str[i] != '0'; i++) {
        char ch = tolower(str[i]);

        if (isalpha(ch)) {
            if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
                vowels++;
            } else {
                consonants++;
            }
        }
    }

    printf("Vowels: %dn", vowels);
    printf("Consonants: %dn", consonants);

    return 0;
}
πŸ“€ Output:
Input: Hello World
Output: Vowels: 3
Output: Consonants: 7

Input: Programming is fun
Output: Vowels: 5
Output: Consonants: 11

Input: 123 abc DEF
Output: Vowels: 1
Output: Consonants: 3

Input: AEIOUaeiou
Output: Vowels: 10
Output: Consonants: 0

Input: QwRtY
Output: Vowels: 1
Output: Consonants: 4

πŸ’» Calculate Length of String (Without strlen())
#include <stdio.h>

int main() {
  char str[100];
  int length = 0;

  printf("Enter a string: ");
  scanf("%s", str);

  while (str[length] != '0') {
    length++;
  }

  printf("Length of the string: %dn", length);

  return 0;
}
πŸ“€ Output:
Input: Hello
Output: Enter a string: Length of the string: 5

Input: This is a test
Output: Enter a string: Length of the string: 4

Input: C programming
Output: Enter a string: Length of the string: 1

πŸ”§ Strings

πŸ’» Search in Row-wise and Column-wise Sorted Matrix
#include <stdio.h>
#include <stdbool.h>

int main() {
    int rows, cols, target;

    printf("Enter the number of rows: ");
    scanf("%d", &rows);
    printf("Enter the number of columns: ");
    scanf("%d", &cols);

    int matrix[rows][cols];

    printf("Enter the elements of the matrix (row-wise sorted):n");
    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            scanf("%d", &matrix[i][j]);
        }
    }

    printf("Enter the target element to search: ");
    scanf("%d", &target);

    int row = 0;
    int col = cols - 1;

    while (row < rows && col >= 0) {
        if (matrix[row][col] == target) {
            printf("Element found at (%d, %d)n", row, col);
            return 0;
        } else if (matrix[row][col] < target) {
            row++;
        } else {
            col--;
        }
    }

    printf("Element not foundn");

    return 0;
}
πŸ“€ Output:
Input: 3
Input: 3
Input: 1
Input: 4
Input: 7
Input: 2
Input: 5
Input: 8
Input: 3
Input: 6
Input: 9
Input: 5
Output: Enter the number of rows: Enter the number of columns: Enter the elements of the matrix (row-wise sorted):
Enter the target element to search: Element found at (1, 1)

πŸ’» Wave Form Traversal of Matrix
#include <stdio.h>

int main() {
    int rows, cols;

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

    printf("Enter the number of columns: ");
    scanf("%d", &cols);

    int matrix[rows][cols];

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

    printf("Wave form traversal of the matrix:n");

    for (int j = 0; j < cols; j++) {
        if (j % 2 == 0) {
            // Even column: Traverse top to bottom
            for (int i = 0; i < rows; i++) {
                printf("%d ", matrix[i][j]);
            }
        } else {
            // Odd column: Traverse bottom to top
            for (int i = rows - 1; i >= 0; i--) {
                printf("%d ", matrix[i][j]);
            }
        }
    }

    printf("n");

    return 0;
}
πŸ“€ Output:
Input: 3
Input: 4
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Input: 7
Input: 8
Input: 9
Input: 10
Input: 11
Input: 12
Output: Enter the number of rows: Enter the number of columns: Enter the elements of the matrix:
Wave form traversal of the matrix:
1 5 9 10 6 2 3 7 11 12 8 4

πŸ’» Spiral Order Traversal of Matrix
#include <stdio.h>

int main() {
    int rows, cols, i, j;

    printf("Enter the number of rows: ");
    scanf("%d", &rows);
    printf("Enter the number of columns: ");
    scanf("%d", &cols);

    int matrix[rows][cols];

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

    int top = 0, bottom = rows - 1, left = 0, right = cols - 1, dir = 0; // 0: right, 1: down, 2: left, 3: up

    printf("Spiral order traversal: ");
    while (top <= bottom && left <= right) {
        if (dir == 0) {
            for (i = left; i <= right; i++) {
                printf("%d ", matrix[top][i]);
            }
            top++;
        } else if (dir == 1) {
            for (i = top; i <= bottom; i++) {
                printf("%d ", matrix[i][right]);
            }
            right--;
        } else if (dir == 2) {
            for (i = right; i >= left; i--) {
                printf("%d ", matrix[bottom][i]);
            }
            bottom--;
        } else if (dir == 3) {
            for (i = bottom; i >= top; i--) {
                printf("%d ", matrix[i][left]);
            }
            left++;
        }
        dir = (dir + 1) % 4;
    }
    printf("n");

    return 0;
}
πŸ“€ Output:
Input: 3
Input: 3
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Input: 7
Input: 8
Input: 9
Output: Enter the number of rows: Enter the number of columns: Enter the elements of the matrix:
Spiral order traversal: 1 2 3 6 9 8 7 4 5

πŸ’» Rotate Matrix by 90 Degrees
#include <stdio.h>

int main() {
  int n;
  printf("Enter the size of the square matrix: ");
  scanf("%d", &n);

  int matrix[n][n];

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

  int rotated_matrix[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      rotated_matrix[j][n - 1 - i] = matrix[i][j];
    }
  }

  printf("Rotated Matrix (90 degrees clockwise):n");
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", rotated_matrix[i][j]);
    }
    printf("n");
  }

  return 0;
}
πŸ“€ Output:
Input: 3
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Input: 7
Input: 8
Input: 9
Output: Enter the size of the square matrix: Enter the elements of the matrix:
Rotated Matrix (90 degrees clockwise):
7 4 1
8 5 2
9 6 3

πŸ’» Matrix Multiplication Validation
#include <stdio.h>

int main() {
    int rowsA, colsA, rowsB, colsB;

    printf("Enter the number of rows for matrix A: ");
    scanf("%d", &rowsA);
    printf("Enter the number of columns for matrix A: ");
    scanf("%d", &colsA);

    printf("Enter the number of rows for matrix B: ");
    scanf("%d", &rowsB);
    printf("Enter the number of columns for matrix B: ");
    scanf("%d", &colsB);

    if (colsA == rowsB) {
        printf("Matrix multiplication is possible.n");
    } else {
        printf("Matrix multiplication is not possible.n");
    }

    return 0;
}
πŸ“€ Output:
Input: 2
Input: 3
Input: 3
Input: 4
Output: Enter the number of rows for matrix A: Enter the number of columns for matrix A: Enter the number of rows for matrix B: Enter the number of columns for matrix B: Matrix multiplication is possible.

Input: 2
Input: 3
Input: 4
Input: 5
Output: Enter the number of rows for matrix A: Enter the number of columns for matrix A: Enter the number of rows for matrix B: Enter the number of columns for matrix B: Matrix multiplication is not possible.

πŸ’» Find Minimum Element in Matrix
#include <stdio.h>
#include <limits.h>

int main() {
    int rows, cols, i, j;

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

    printf("Enter the number of columns: ");
    scanf("%d", &cols);

    int matrix[rows][cols];

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

    int min = INT_MAX;

    for (i = 0; i < rows; i++) {
        for (j = 0; j < cols; j++) {
            if (matrix[i][j] < min) {
                min = matrix[i][j];
            }
        }
    }

    printf("Minimum element in the matrix is: %dn", min);

    return 0;
}
πŸ“€ Output:
Input: 2
Input: 3
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Output: Minimum element in the matrix is: 1

πŸ’» Find Maximum Element in Matrix
#include <stdio.h>

int main() {
    int rows, cols;

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

    printf("Enter the number of columns: ");
    scanf("%d", &cols);

    int matrix[rows][cols];

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

    int max = matrix[0][0];

    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            if (matrix[i][j] > max) {
                max = matrix[i][j];
            }
        }
    }

    printf("Maximum element in the matrix is: %dn", max);

    return 0;
}
πŸ“€ Output:
Input: 2
Input: 3
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Output: Maximum element in the matrix is: 6

Input: 3
Input: 2
Input: -1
Input: -2
Input: -3
Input: -4
Input: -5
Input: -6
Output: Maximum element in the matrix is: -1

πŸ’» Find Row Sum and Column Sum
#include <stdio.h>

int main() {
    int rows, cols;

    printf("Enter the number of rows: ");
    scanf("%d", &rows);
    printf("Enter the number of columns: ");
    scanf("%d", &cols);

    int matrix[rows][cols];

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

    printf("Row Sums:n");
    for (int i = 0; i < rows; i++) {
        int rowSum = 0;
        for (int j = 0; j < cols; j++) {
            rowSum += matrix[i][j];
        }
        printf("Row %d: %dn", i + 1, rowSum);
    }

    printf("Column Sums:n");
    for (int j = 0; j < cols; j++) {
        int colSum = 0;
        for (int i = 0; i < rows; i++) {
            colSum += matrix[i][j];
        }
        printf("Column %d: %dn", j + 1, colSum);
    }

    return 0;
}
πŸ“€ Output:
Input: 2
Input: 3
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Output: Enter the number of rows: Enter the number of columns: Enter the elements of the matrix:
Row Sums:
Row 1: 6
Row 2: 15
Column Sums:
Column 1: 5
Column 2: 7
Column 3: 9