-->

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;
}

WAP to reverse a string using(strrev()) function.

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

//WAP to get /find length of string using(strlen()) function.

using turbo c++
--------------------------------------------------------------------------------------------
//WAP to get /find length of string using(strlen()) function.

#include <stdio.h>
#include<conio.h>
int main()
{
    char name[100];//two dimensional declaration
    int i,count=0;              //declaration with initialization
    printf("enter string\n");
    gets(name);
    for(i=0;name[i]!='\0';i++)//loop execution till it reaches \0 character
    {
        count++;            //counting goes on
    }
    printf("total length=%d\n",count);//prints the length
    getch();
     return 0;
}
-----------
or
---------------------
//WAP to get /find length of string using(strlen()) function.

#include <stdio.h>
#include<conio.h>
int main()
{
    char name[100];//two dimensional declaration
    int i;              //declaration with initialization
    printf("enter string\n");
    gets(name);
    for(i=0;name[i]!='\0';i++);//loop execution till it reaches \0 character; no body line.
    printf("total length=%d\n",i);//prints the length
    getch();
     return 0;
}

------------------------------------------------------------
using codeblocks:
-----------------------------------------------------------------------------
//WAP to get /find length of string using(strlen()) function.

#include <stdio.h>
int main()
{
    char name[100];//two dimensional declaration
    int i,count=0;              //declaration with initialization
    printf("enter string\n");
    gets(name);
    for(i=0;name[i]!='\0';i++)//loop execution till it reaches \0 character
    {
        count++;            //counting goes on
    }
    printf("total length=%d\n",count);//prints the length
   
     return 0;
}

/WAP to input any five names with address and display them.

using turboc++
------------------------------------------------------------
//WAP  to input any five names with address and display them.
#include <stdio.h>
#include<conio.h>
int main()
{
    char name[100][100];//two dimensional declaration
    char add[100][100];//two dimensional declaration
    int i,n;
    printf("enter n\n");
    scanf("%d",&n);
    printf("enter names and addresses\n");
    for(i=0;i<=n-1;i++)
    {
        printf("name \n");
        scanf("%s",name[i]);//gets inputs for name
        printf("address=\n");
        scanf("%s",add[i]);//gets address
    }
    printf("names and addresses are=\n");
    for(i=0;i<=n-1;i++)
    {
        printf("name =%s and adddress=%s\n",name[i],add[i]);//prints the data .
   
    }
getch();
     return 0;
}
------------------------------------

---------------------------------------------------------
using codeblocks
---------------------------------------
//WAP  to input any five names with address and display them.
#include <stdio.h>

int main()
{
    char name[100][100];//two dimensional declaration
    char add[100][100];//two dimensional declaration
    int i,n;
    printf("enter n\n");
    scanf("%d",&n);
    printf("enter names and addresses\n");
    for(i=0;i<=n-1;i++)
    {
        printf("name \n");
        scanf("%s",name[i]);//gets inputs for name
        printf("address=\n");
        scanf("%s",add[i]);//gets address
    }
    printf("names and addresses are=\n");
    for(i=0;i<=n-1;i++)
    {
        printf("name =%s and adddress=%s\n",name[i],add[i]);//prints the data .
   
    }
     return 0;
}