-->

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


No comments:

Post a Comment