0

Input :
"Howdy! Hope your day goes well!"
"The inhabitants of Universe are called Guardians"
"UniVerSE UNIVERSE universe are different ways to write Universe!"
Output :
"Hello, World!"
"Hello, Universe!"
"Hello, Universe!!!!"
------------------------------------------------

    #include<stdio.h>  
    #include<string.h>
    int main()  
    {  
       char str[200],str1[]="Hello Universe",str2[]="!"; 
       int value;
       scanf("%s",str);  
       // comparing both the strings using strcmp() function  
       int count =0;
       value=strcmp(str,("universe"));  
       for (int i = 0; i < count; i++){
       if(value==0)  {
           strcat(str1,str2);
            printf(str1);
       }
       else  
       printf("Hello world!");  
       return 0;  
       }
    } 
  • 1
    Have you checked https://linux.die.net/man/3/strcasecmp ? – babon Dec 07 '21 at 15:55
  • C does not ignore case; but, there are functions that compare strings where those functions consider 'c' and 'C' to be the same character. – Edwin Buck Dec 07 '21 at 16:12

0 Answers0