02-09-2008, 06:51 AM
|
#1 |
| Addicted to Computer
Join Date: Sep 2007 Location: ------------ Age: 22
Posts: 1,336
Thanks: 597
Thanked 354 Times in 287 Posts
Contact Number: --------------- Program / Discipline: BSIT Class Roll Number: 07-01 Time Spent Online: 1 Month 3 Days 8 Hours 29 Minutes 9 Seconds | [C++] Programme to display an email address before @ sign The simple One |  | | | #include <iostream>
using namespace std;
char email[20];
string output;
int index;
int main()
{
index=0;
cout<<"please enter and email address : ";
cin>>email;
while(email[index]!='@')
{
cout<<email[index];
index++;
}
cout<<endl;
return 0;
} | | |  | | | An extended One |  | | |
#include <iostream>
using namespace std;
char email[20];
char output[20];
int index;
int main()
{
index=0;
cout<<"please enter and email address : ";
cin>>email;
while(email[index]!='@')
{
output[index]=email[index];
index++;
}
output[index]='\0';
cout<<"Email Address Before @ sign is "<<output<<endl;
return 0;
} | | |  | | | |
| |