Write C Functions String Operations Assignments Pls Give Examples Solutions C Q37148589

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.