Computer Science, asked by poo1, 1 year ago

write a c++ program to accept the name ; age and salary of 10 emplpyees

Answers

Answered by karthik4297
3
#include #include using namespace std; int main() { int age[10]; string age[10]; float salary[10]; cout<<"enter the name, age and salaries of employees "; for(int i=0;i<=10;i++) { cin>>name; cin>>age; cin>>salary; } // display the values namewise for(int i=0;i<=10;i++) { cout<
Answered by kvnmurty
0
# include <string>
#define N   10

Using namespace std;        // using the standard input and standard output


Class   employee : public
 
{
        String   name[N];  
        int   age [N], salary [N];

        employee() {
              for (i=0;i< N; i++) {
                   name [i] = “ default  “;  age[i] = 100 ;  salary [i]= 1000000 ;
              }
 
       }

        public void main ()
        {
  
          int  i;
             for ( i = 0; i < 10 ; i++) {
           
       cout << “Enter name   age   salary:  “   << flush ;
                  cin >> name [i];                 cin >> age [i];                 cin >> salary[i];

                   if (name == “”)
                         cout << “enter correct name” ;
                   else
  
                      cout <<  “Details :  “ + name + age + salary ;
              }  // for
        } // main

} // class



kvnmurty: click on thanks button above;;; select best answer
Similar questions