Wednesday, 2 March 2016

Q. Calculating monthly sales ?

THE OUTPUT WOULD BE














#include<iostream.h>
#include<conio.h>
class A
{ int a[10],t,i;
public:
void B();
void C();
};
void A::B()
{       t=0;
cout<<"Enter your monthly sales:\n";
for(i=0;i<10;i++)
{ cin>>a[i];
 t=t+a[i];
}
}
void A::C()
{       cout<<"Total amount of monthly sales:";
cout<<t;
}
void main()
{ clrscr();
A obj;
obj.B();
obj.C();
getch();
}

No comments:

Post a Comment