C Program to Remove all Characters in a String Except Alphabet

In this tutorial you will learn about the C Program to Remove all Characters in a String Except Alphabet and its application with practical example.

C Program to Remove all Characters in a String Except Alphabet

In this tutorial, we will learn to create a C program that will Remove all Characters in a String Except Alphabet in C programming.

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in c programming.
  • While loop in c programming.

Remove all Characters in a String Except Alphabet.

As we all know the String is a collection of character data types. In strings, only one variable is declared which can store multiple values. First will take the string from the user. Then will pass that string to a for loop to filter the numbers from that string.

With the help of this program, we can Remove all Characters in a String Except Alphabet.

Algorithm:-

 

Program to Remove all Characters in a String Except Alphabet:-

 

 

Output:-

In the above program, we have first initialized the required variable.

  • line[150] = it will hold the string value.
  • i  = it will hold the integer value for the loop.
  • j = it will hold the integer value for the loop.

Taking input string from the user.

Scanning the input string from the user.

Storing the string and extracting only string data by for loop.

Printing output of the program.

In this tutorial we have learn about the C Program to Remove all Characters in a String Except Alphabet and its application with practical example. I hope you will like this tutorial.