avatar
Untitled

Guest 35 14th Jan, 2020

MARKUP 2.49 KB
                                           
                         #include <iostream>
using namespace std;
struct per
{
    string name;
    string f_name;
    string g_name;
};

int main()
{
    //string ch;
    //top:
per f1 ;
 cout<<"Enter your name";
                getline(cin,f1.name);



        //cout<<"Enter your Father Name";
        //getline(cin,f1.f_name);
        //cout<<"Enter Grand Father name";
        //getline(cin,f1.g_name);




        /*cout<<"Enter your Father Name";
        getline(cin,f2.f_name);
        cout<<"Enter Grand Father name";
        getline(cin,f2.g_name);*/

        //per f3;

/*cout<<"Enter your name";
        getline(cin,f3.name);
        cout<<"Enter your Father Name";
        getline(cin,f3.f_name);
        cout<<"Enter Grand Father name";
        getline(cin,f3.g_name);*/

        for(int i=0;i<10;i++)
        {

            //for(int j=0;j<3;j++)
            //{
                if (f1.name=="Hamza")
                {
                    f1.f_name="P";
                    f1.g_name="G";
                    cout<<"Your Father Name   "<<f1.f_name<<endl;
                cout<<"Your Grand Father Name  "<<f1.g_name<<endl;
                break;

                }



                if (f1.name=="Safwan")
                {
                    f1.f_name="x";
                    f1.g_name="y";
                    cout<<"Your Father Name   "<<f1.f_name<<endl;
                    cout<<"Your Grand Father Name   "<<f1.g_name<<endl;
                    break;
                }

                if (f1.name=="Haza")
                {
                    f1.f_name="A";
                    f1.g_name="B";
                    cout<<"Your Father Name  "<<f1.f_name<<endl;
                cout<<"Your Grand Father Name   "<<f1.g_name<<endl;
                break;

                }



            //}
        }
             /*   cout<<"do continue = ";
                cin>>ch;
                if(ch=="y")
                {
                  goto top;
                }*/





 }
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes