Example 2 on Class

#include<iostream.h>
#include<conio.h>


class sum
{
    private:
        float x,y,z,total;
    public:
        void add();
};
main()
{
    sum zz;
    zz.add();
    getch();
    return 0;
}
void sum::add()
{
    x=10.89;
    y=70.56;
    z=56.96;
    total=x+y+z;
    cout<<"Total is "<<total;
}