Category: C program

python tutorials and learn python

Created with Sketch.

C Program to Sort Elements in Lexicographical Order (Dictionary Order)

C Program to Sort Elements in Lexicographical Order (Dictionary Order) This program sorts the 5 strings entered by the user in the lexicographical order (dictionary order). This program takes 5 words (strings) from the user and sorts them in lexicographical order. Example: Sort strings in the dictionary in order Output Enter 5 words: R programming…
Read more

C Program to Copy String Without Using strcpy()

C Program to Copy String Without Using strcpy() In this article, you’ll learn to copy string without using the library function strcpy(). You can use the strcpy() function to copy the content of one string to another but, this program copies the content of one string to another manually without using strcpy() function. Example: Copy…
Read more

C Program to Concatenate Two Strings

C Program to Concatenate Two Strings In this article, you’ll learn to easily concatenate two strings without using the standard library function strcat(). You can concatenate two strings easily using the standard library function strcat() but, this program concatenates two strings manually without using strcat() the function. Example: Concatenate Two Strings Without Using strcat() Output…
Read more

C Program to Find the Length of a String

C Program to Find the Length of a String In this article, you’ll learn to find the length of a string without using strlen() function. You can use the standard library function strlen() to find the length of a string but, this program computes the length of a string manually without using strlen() function. Example:…
Read more

C Program to Remove all Characters in a String Except Alphabets

C Program to Remove all Characters in a String Except Alphabets This program takes a string from user and removes all characters in that string except alphabets. Example: Remove Characters in String Except for Alphabets     This program takes a string from the user and stored it in the variable line.   , within…
Read more

C Program to Count the Number of Vowels, Consonants, and so on

C Program to Count the Number of Vowels, Consonants, and so on This program counts the number of vowels, consonants, digits, and white spaces in a string that is entered by the user. Example: Program to count vowels, consonants, etc. Output Enter a line of string: adfslkj34 34lkj343 34lk Vowels: 1 Consonants: 11 Digits: 9…
Read more

C Program to Find the Frequency of Characters in a String

C Program to Find the Frequency of Characters in a String This program asks the user to enter a string and a character and checks how many times the character is repeated in the string. Example: Find the Frequency of Characters Output Enter a string: This website is awesome. Enter a character to find the…
Read more

C Program to Find Largest Number Using Dynamic Memory Allocation

C Program to Find Largest Number Using Dynamic Memory Allocation In this program, you’ll learn to use calloc() function to allocate the memory dynamically to find the largest element. Depending upon the number of elements, the required size is allocated which prevents the wastage of memory.  If no memory is allocated, error is displayed and…
Read more

C Program Swap Numbers in Cyclic Order Using Call by Reference

C Program Swap Numbers in Cyclic Order Using Call by Reference This program takes three integers from the user and swaps them in cyclic order using pointers. Three variables entered by the user are stored in variables a, b, and c respectively. Then, these variables are passed to the function cyclicSwap(). Instead of passing the…
Read more

C Program to Access Array Elements Using Pointer

C Program to Access Array Elements Using Pointer This program declares an array of five elements, and the elements of the array are accessed using a pointer. Example: Access Array Elements Using Pointers Output Enter elements: 1 2 3 5 4 You entered: 1 2 3 5 4 In this program, the elements are stored…
Read more