Q:

C program to Change string to lower case without strlwr

belongs to collection: C language string programs

0

C program to Change string to lower case without strlwr.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

I have used Code:: Blocks compiler for debugging purpose. But you can use any C programming language compiler as per your availability.

#include <stdio.h>

   void functionlower(char []);

   int main()
   {
      char string[100];

      printf("Enter a string to convert it into lower case\n");
      gets(string);

      functionlower(string); // calling functionlower

      printf("Entered string in lower case is %s", string);

      return 0;
   }

   void functionlower(char s[]) {
      int c = 0;

      while (s[c] != '\0') {
         if (s[c] >= 'A' && s[c] <= 'Z') {
            s[c] = s[c] + 32;
         }
         c++;
      }
   }

Result:

Enter a string to convert it into lower case

WWW.TECHSTUDY.ORG

Entered string in lower case is www.techstudy.org

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C program to reverse a string enter by user.... >>
<< C program to change string to upper case without s...