BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Data Structure (http://bzupages.com/32-data-structure/)
-   -   [C++] Programme to display an email address before @ sign (http://bzupages.com/f32/%5Bc-%5D-programme-display-email-address-before-%40-sign-677/)

BSIT07-01 02-09-2008 05:51 AM

[C++] Programme to display an email address before @ sign
 
The simple One
Code:

#include
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<         index++;

    }
    cout<
    return 0;
}

An extended One

Code:


#include
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 "<





    return 0;
}



All times are GMT +5. The time now is 09:40 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.