-3
#include<iostream>

using namespace std;
main()    

{   
    int em;
    char name,add;

    cout<<"\n enter number of employees : ";
    cin>>em;
    // here we took an input by the name employee...

    while(em<=9)      //using while loop

Employee number is stored in em and put in the loop... In order to put multiple responses I put two input keywords in code block... but it's not working properly.

    {
        cout<<"\n enter name: ";      //code block 
        cin>>name;
        cout<<"\n enter address : ";
        cin>>add;

        em=em+1;

    }
    return 0;
}
pacholik
  • 8,607
  • 9
  • 43
  • 55
Ron
  • 3
  • 1

1 Answers1

2

The problem is in your declaration of char name,add; It should be either something like char name[100],add[100]; or (in more modern, safer C++) std::string name,add;. In the latter case you also need to #include <string>.

Eugene
  • 6,194
  • 1
  • 20
  • 31