-->

WAP to compare two strings using strcmp() function.

using turboc++
---------------------------------------------------------------------------------------------------------------------
//WAP to compare  two strings  using(strcmp()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    gets(st);
    printf("enter second string\n");
     gets(st1);//inputs
    if(strcmp(st,st1)>0)//
    {
        printf("%s has more ascii value than %s",st,st1);
    }
    else if(strcmp(st,st1)<0)
    {
        printf("%s has more ascii value than %s",st1,st);

    }
    else
    {
        printf("%s and %s have same ascii value",st,st1);
    }
getch();
    return 0;
}


---------------------------------------------------------------------------------------
using codeblocks
------------------------------------------------------------------------------------------------
//WAP to compare  two strings  using(strcmp()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    gets(st);
    printf("enter second string\n");
     gets(st1);//inputs
    if(strcmp(st,st1)>0)//
    {
        printf("%s has more ascii value than %s",st,st1);
    }
    else if(strcmp(st,st1)<0)
    {
        printf("%s has more ascii value than %s",st1,st);

    }
    else
    {
        printf("%s and %s have same ascii value",st,st1);
    }
    return 0;
}


WAP to concatenate /merge two strings using strcat() function.

using turboc++
--------------------------------------------------------------------------------------------------
//WAP to merge  two strings  using(strcat()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    gets(st);
    printf("enter second string\n");
     gets(st1);//inputs
    strcat(st,st1);//merging st1 string into first (st)
    printf("merged string =%s\n",st);//prints the merged strings(st)
   getch();
    return 0;
}


---------------------------------------------------------------------------------------------------
using codeblocks
----------------------------------------------------------------------------------------------------
//WAP to merge  two strings  using(strcat()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    gets(st);
    printf("enter second string\n");
     gets(st1);//inputs
    strcat(st,st1);//merging st1 string into first (st)
    printf("merged string =%s\n",st);//prints the merged strings(st)
    return 0;
}

WAP to copy a string using strcpy().

using turboc++
-------------------------------------------------------------------------------------------
//WAP to copy  a string  using(strcpy()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",st); //it also CAN BE USED. IT accepts string with space until it meets new line
    strcpy(st1,st);//copying a string into first
    printf("copied string =%s\n",st1);//prints the copied name
    getch();
    return 0;
}

---------------------------------------------------------------------------------------
using codeblocks
-------------------------------------------------------------------------------------------------------------
//WAP to copy  a string  using(strcpy()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",st); //it also CAN BE USED. IT accepts string with space until it meets new line
    strcpy(st1,st);//copying a string into first
    printf("copied string =%s\n",st1);//prints the copied name
    return 0;
}

WAP to convert string into lowercase using strlwr() function

using turbo c++
---------------------------------------------------------------------------
//WAP to convert  a string into lowercase using(strlwr()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
    char name[100];//declaration
    printf("enter string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",name); //it also CAN BE USED. IT accepts string with space until it meets new line
    strlwr(name);
    printf("string in lowercase=%s\n",name);//prints the name in lowercase
   getch();
    return 0;
}

--------------------------------------------------------------------------------------------------
using codeblocks
----------------------------------------------------------------------------------------------------------

//WAP to convert  a string into lowercase using(strlwr()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char name[100];//declaration
    printf("enter string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",name); //it also CAN BE USED. IT accepts string with space until it meets new line
    strlwr(name);
    printf("string in lowercase=%s\n",name);//prints the name in lowercase
    return 0;
}

WAP to convert string into uppercase using strupr() function.

using turboc++
--------------------------------------------------------------------------------
//WAP to convert  a string into uppercase using(strupr()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
    char name[100];//declaration
    printf("enter string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",name); //it also CAN BE USED. IT accepts string with space until it meets new line
    strupr(name);
    printf("string in uppercase=%s\n",name);//prints the name in uppercase
   getch();
    return 0;
}


------------------------------------------------------------------------------------------------
using codeblocks
--------------------------------------------------------------------------------------------------
//WAP to convert  a string into uppercase using(strupr()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char name[100];//declaration
    printf("enter string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",name); //it also CAN BE USED. IT accepts string with space until it meets new line
    strupr(name);
    printf("string in uppercase=%s\n",name);//prints the name in uppercase
    return 0;
}