Sunday, October 27, 2013

Friend function example 1

#include<iostream.h>

#include<conio.h>

class A

{

int a;

public:

void getA()

{

cout<<"Enter a:";

cin>>a;

}

void putA()

{

cout<<"\na="<<a;

}

friend A add(A x, A y);

};

A add(A x, A y)

{

A z;

z.a=x.a+y.a;

return z;

}

int main()

{

A m,n,p;

clrscr();

m.getA();

n.getA();

p=add(m,n);

m.putA();

n.putA();

p.putA();

getch();

return 0;

}

Wednesday, October 23, 2013

Dynamic Constructor

#include<iostream.h>
#include<conio.h>
#include<string.h>
class A
{
char *nm;
int len;
public:
A()
{
len=0;
nm=new char[len+1];
}
A(char *nm1)
{
len=strlen(nm1);
nm=new char[len+1];
strcpy(nm,nm1);
}
void putA()
{
cout<<"\nName="<<nm;
}
};
int main()
{
char s[20];
clrscr();
cout<<"Enter Name:";
cin>>s;
A a1,a2(s);
a1=a2;
a1.putA();
a2.putA();
getch();
return 0;
}

Sunday, October 13, 2013

Class and object program of c++

#include<iostream.h>

#include<conio.h>

class student

{

    int rn,m1,m2,total;

    char nm[20];

    public:

        void getdata()

        {

            cout<<"Enter RollNo.:";

            cin>>rn;

            cout<<"Enter Name:";

            cin>>nm;

            cout<<"Enter m1 & m2:";

            cin>>m1>>m2;

        }

        void putdata();

};

void stud :: putdata()

{

    cout<<"\nRoll no.:"<<rn;

    cout<<"\nName:"<<nm;

    cout<<"\nM1:"<<m1;

    cout<<"\nM2:"<<m2;

    cout<<"\nTotal:"<<total;

}

int main()

{

    student s;

    clrscr();

    s.getdata();

    s.putdata();

    getch();

    return 0;

}

Saturday, October 12, 2013

Basic to class C++ Program

#include<iostream.h>
#include<conio.h>
class vector
{
int a[5];
public:
vector(int b[]);
void display();
};
vector :: vector(int b[])
{
for(int i=0;i<5;i++)
a[i]=b[i];
}
void vector :: display()
{
for(int i=0;i<5;i++)
cout<<"\n"<<a[i];
}
int main()
{
int x[5],i;
clrscr();
for(i=0;i<5;i++)
{
cout<<"Enter Value:";
cin>>x[i];
}
vector v=x;
v.display();
getch();
return 0;
}
For more programs comment please.

Friday, October 11, 2013

Array within class program C++

#include<iostream.h>

#include<conio.h>

class A

{

    int a[5];

    public:

        void getA()

        {

            for(int i=0;i<5;i++)

            {

                cout<<"Enter a["<<i<<"]:";

                cin>>a[i];

            }

        }

        void putA();

};

void A :: putA()

{

    for(int i=0;i<5;i++)

        cout<<"\n"<<a[i];

}

int main()

{

    A x;

    clrscr();

    x.getA();

    x.putA();

    getch();

    return 0;

}

Thursday, October 10, 2013

Array of Object C++ Program

#include<iostream.h>

#include<conio.h>

class A

{

int a;

public:

void getA()

{

cout<<"Enter a:";

cin>>a;

}

void putA()

{

cout<<"\na="<<a;
}

};

int main()

{

A x[5];

clrscr();

for(int i=0;i<5;i++)

x[i].getA();

for(i=0;i<5;i++)

x[i].putA();

getch();

return 0;

}

ADS: Discount on eBay with iPhone gold

Wednesday, October 9, 2013

End of Walmart and Bharti Enterprises joint connection in India

Ending of the joint venture of Walmart and Bharti enterprises on Wednesday 9th October 2013 and they are going to separate ways for business in Indian market.

Subsequently, the US retail major will buy out the Indian partner from their 50:50 wholesale cash and carry joint venture — Bharti Walmart, for an undisclosed sum.

In a joint statement, the companies said they have reached an agreement to independently own and operate separate business formats in India and discontinue their franchise agreement in the retail business.The agreement is subject to finalization of definitive agreements and receipt of the requisite regulatory approvals, it said.

Commenting on the development Bharti Enterprises vice-chairman and MD Rajan Bharti Mittal said: Bharti is committed to building a world-class retail venture and will continue to invest in Bharti Retail across all formats. We believe that with our current footprint of 212 stores, we have a strong platform to significantly grow the business and delight customers.

As part of the proposed transactions, Bharti will acquire the $100 million worth Compulsory Convertible Debentures (CCDs) held by Walmart in Cedar Support Services, a company owned and controlled by Bharti. Bharti Retail will continue to operate easy day retail stores across all formats and invest in and grow the business.

The investment in Cedar by Walmart is being investigated by the Enforcement Directorate following allegations of violations of norms. 

Given the circumstances, our decision to operate independently will be beneficial to both parties, Walmart Asia president and CEO Scott Price said. 

Walmart is committed to businesses that serve members and provide good returns for our shareholders, and will continue to advocate for investment conditions that allow FDI multibrand retail in India, he added. 

Through Walmart's investment in India, including our cash and carry business, supply chain infrastructure, direct farm program and supplier development, we want to serve India and its people, and continue to make important social and environmental contributions to the country, Price said. 

At present, there are 20 Best Price Modern Wholesale stores located at various places, including Amritsar, Zirakpur, Jalandhar, Kota, Bhopal Ludhiana, Raipur, Indore, Vijayawada, Agra, Meerut, Lucknow and Jammu. 

ADS: Get some Discount on iphone 5c and iphone 5s only on eBay