Write a C program to accept a string and convert it into lower case using standard library function.

C file =>

/* Write a C program to accept a string and convert it into lower case using standard library function. */


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<ctype.h>
int main() 
{

char s1[50];
int i;
printf("\n Enter String: ");
scanf("%s",s1);
printf("\n Converted String: ");
for(i=0;i<strlen(s1);i++)
printf("%c",tolower(s1[i]));
return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.