google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: C program for 2-D array

Wednesday, April 1, 2015

C program for 2-D array

Write a ‘C’ program to accept ‘n’ names from user store these name into
2-D array. Accept the name from user and search whether the name is
present in an array or not.

#include<stdio.h>
#include<conio.h>
void main()
{
char name[5][10],res[10];
int i,j,n;
clrscr();
printf("enter the no");
scanf("%d",&n);
printf("enter the matrix element");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%s",&name[i][j]);
}
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
printf("enter the name");
scanf("%s",&res);
if(strcmp(&name[i][j],&res)!=0)
{
printf("name is not found");
break;
}
else
{
printf("name is found");
}
}
}
getch();
}

रामायण

रामायण दशरथ की तीन पत्नियाँ – कौशल्या, सुमित्रा , कैकेयी दशरथ के चार पुत्र – राम,लक्ष्मण,भरत,शत्रुघ्न दशरथ: राम के पिता और कौशल के राजा कौशल...