Change String into Lowercase

C program for Change String into Lowercase

#include<stdio.h>
#include<conio.h>
void low_str (char[]);
int main()
{
  char string[100];
  printf("Enter a string to convert it into Lower case :   ");
  gets(string);
  low_str(string);
  printf("Entered String  converted into lower case is: \"%s\"\n", string);
  return 0;
}

//function for string convert into lower string

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

 
output 

Enter a string to convert it into Lower case :   Raman IS A gOOd Boy
Entered String converted into lower case is: "raman is a good boy"

Comments

Popular posts from this blog

C program that contains a string XOR each character in this string with 0 ,127

Queue in Data Structure(DS)

Implementation of stack Using Array