fork download
  1. #include <iostream>
  2. using namespace std;
  3. class employee{
  4. public: string name;
  5. float salary;
  6. void input(){
  7. cout<<"enter name"<<endl;
  8. cin>>name;
  9. cout<<"enter salary"<<endl;
  10. cin>>salary;
  11. }
  12. void showannualsalary(){
  13. cout<<"annualsalary of"<<"\nname="<<salary*12<<endl; }
  14. };
  15. int main(){
  16. employee e;
  17. e.input();
  18. e.showannualsalary();
  19.  
  20. }
Success #stdin #stdout 0.01s 5328KB
stdin
khushi
120000
stdout
enter name
enter salary
annualsalary of
name=1.44e+06