Store names of n students into an array and then search for a particular name
#include
#include
#include
#include
void main()
{
int i,n,big;
int flag;
char name[100][25];
char t[25];
cout<<”Enter how many elements : “;
cin>>n;
for(i=0;i
gets(name[i]);
cout<<”Enter a name for search : “;
gets(t);
flag=0;
for(i=0;i
if(strcmp(name[i],t==0)
{
flag=1;
break;
}
if(flag= =1)
cout<<”The given name is found in the position “<
else
cout<<”The given name is not found”;
getch();
}
Thursday, December 10, 2009
Home »
C++ PROGRAM TO STORE NAMES OF N STUDENTS
,
STORE NAMES OF N STUDENTS INTO AN ARRAY USING C++
,
STORE NAMES OF N STUDENTS USING C++
» C++-->STORE NAMES OF N STUDENTS INTO AN ARRAY
C++-->STORE NAMES OF N STUDENTS INTO AN ARRAY
5:07 AM
C++ PROGRAM TO STORE NAMES OF N STUDENTS, STORE NAMES OF N STUDENTS INTO AN ARRAY USING C++, STORE NAMES OF N STUDENTS USING C++
No comments
0 comments:
Post a Comment