Blog Moved

This website completely moved to new domain. For latest content, visit www.programmingposts.com

Search This Blog

9 Mar 2013

C PROGRAM EXAMPLE FOR tolower() FUNCTION


C PROGRAM EXAMPLE FOR tolower() FUNCTION

#include <stdio.h>
//#include<string.h>
int main() 
{
  int i;
  char str[20];
  printf("\n >>> C PROGRAM TO IMPLEMENT tolower() FUNCTION <<< \n");
  printf( "\n Enter the string in Caps or Mixed Case: ");
  //scanf("%s",&str); //wont allow spaces
  gets(str); //gets() allows apaces
  printf("\n The entered string in Lower Case is: ");
  for(i=0;i<=strlen(str);i++)
  {
      printf("%c",tolower(str[i]));
  }
  getch();
  return 0;
}

Output :

1 comment: