Write C functions to do string operations, assignments
pls give examples with solutions in C
Solution
#include <stdio.h>#include <string.h>int main(){ char str[100]; printf(“Enter string: “); scanf(“%s”,str); //1. strlen() printf(“String length: %dn”, strlen(str)); //2. strlwr() //3. strcpy() //Changed the string to lowercase and replaced that old string with new string strcpy(str,strlwr(str)); printf(“Lowercase string: %sn”, str); //4. struper() //Changed the string to uppercase and replaced that old string with new string
OR
OR