C program to Change string to lower case without strlwr


Introduction

C program to Change string to lower case without strlwr. I have used Code:: Blocks compiler for debugging purpose. But you can use any C programming language compiler as per your availability.


techstudy.org

techstudy.org Step by step debugging solution for programmers HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    #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

C language

     





Related Topics





Popular Posts