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

Display Browser information using javascript

Understanding Activation Functions in Deep Learning and Machine Learning

Understanding the Differences between POST, PUT, and PATCH in REST APIs