C Program to convert all letters from a text file to Lower Case

C Program to convert all letters from a text file to Lower Case

This page has a C Program to convert all letters from a text file to Lower Case. It is clear that, this program has to read all the content from an existing file as input (the text file must be created earlier either through notepad or ms-word or by any other way).Then, the program will convert the letters of contents into Lower case. The below given C program is used to convert all letters from a text file into Lower Case. Kindly check out the program to convert all letters from a text file into Lower Case.

How can ask to convert all letters from a text file to Lower Case

The questions to convert all letters from a text file to Lower Case can be asked as,  1). C program to convert all the letters from a text file into Lower Case.  2). C Program to convert the letters from a data file to Lower Case.  3). C Program to convert letters available from a text file to Lower Case.  4). C Program to convert all letters to Lower Case in a text file.  5). C program to convert all letters to Lower Case in a data file.  6). C program to convert all letters present in a text file to Lower Case.


Program to convert all letters from a text file to Lower Case 

  #include<stdio.h>
  int main(){
          FILE *fpoint1, *fpoint2;
          char fchar1, fchar2;
          char name1[20], name2[20];
          clrscr();
          printf("\n Give the Existing file name to Read:");
          gets(name1);
          printf("\n Give the file name for the lower case of existing file contents :");
          gets(name2);
          fpoint1 = fopen(name1, "r");
          fpoint2 = fopen(name2, "w");
          if (fpoint1 == NULL)
          printf("\n The file %s has no content !", name1);
          else
          {
          do {
          fchar1 = getc(fpoint1);
          fchar2 = tolower(fchar1);
          fputc(fchar2, fpoint2);
          } while (fchar1 != EOF);
          fcloseall();
          }
          getch();
          return (0);
          }


Sample Outputs:

To run the above program, we should Create a Text (data) file as input either by using any Text editor (for example: notepad or notepad++ or Ms-word) before to run the program. If input text file is not created earlier for using it in the program with 'r' mode, the program will give the output as "This file has no content ! 


Related Popular Posts:

Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

Bookmark and Share