Saved Bookmarks
| 1. |
Rewrite the following program after removing the syntactical error(s) (if any). Underline each correction.#include[iostream.h]#include[stdio.h]class Employee { int EmpId = 901; char EName[20]; public:Employee() {}void Joining(){cin>>EmpId; gets(EName);}void List (){cout<<EmpId<<":" <<EName<<end1;}}void main() {Employee E;Joining.E ();E.List () ;} |
|
Answer» #include <iostream.h> #include <stdio.h> class Employee { int EmpId; char EName [20] ; public: Employee () {} void Joining() { cin>>EmpId; gets(EName); } void List() { cout<<EmpId<<":" <<EName<<endl; } }; void main() { Employee E; E.Joining(); E.List(); } |
|