|
-
Aug 5th, 2012, 03:53 AM
#1
Thread Starter
Addicted Member
[Help] array for my assignment
how to solve this problem?
please help!
#include<iostream.h>
#include<conio.h>
void main()
{
int acct;
char name[50];
char add[50];
int opt;
int index=0;
clrscr();
do{
cout<<"Menu"<<endl;
cout<<"1 add"<<endl;
cout<<"2 view"<<endl;
cout<<"3 exit"<<endl;
cout<<"Choice: ";cin>>opt;
switch(opt)
{
case 1:
clrscr();
cout<<"Enter Account: ";cin>>acct[index];
cout<<"Enter Name: ";cin>>name[index];
cout<<"Enter Add: ";cin>>add[index];
index++;
break;
case 2:
clrscr();
cout<<"Entered Data------"<<endl;
for(int a=0;a<index;a++)
{
cout<<acct[a] <<"\t" <<name[a] <<"\t" <<add[a]<<endl;
}
break;
case 3:
cout<<"Exit";
break;
}
}while(opt!=3);
getch();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|