What's new

Closed C++ project

Status
Not open for further replies.

iamxiis

Honorary Poster
Joined
Jan 16, 2017
Posts
430
Reaction
80
Points
173
Paturo naman po mga sir kung pano e store muna ang information tapos di siya magdidisplay agad pagkatapos mo mag store? eto yung sample ko sir.




#include<iostream>
#include<iomanip>
using namespace std;

struct Employee
{
int Id;
char Name[25];
int Age;
long Salary;
};

int main()
{
int i, n;


cout<<"\nEnter The Number of Employee\n\n";
cin>>n;

Employee Emp[n]; // Structure object created emp

for(i=0;i<n;i++)
{

cout << "\nEnter details of " << i+1 << " Employee"<<endl;

cout <<setw(5)<< "\nEnter Employee Id : ";
cin >> Emp.Id;

cout <<setw(5)<< "\nEnter Employee Name : ";
cin >> Emp.Name;

cout <<setw(5)<< "\nEnter Employee Age : ";
cin >> Emp.Age;

cout <<setw(5)<< "\nEnter Employee Salary : ";
cin >> Emp.Salary;

}

cout<<"\n\n------------------------------------------------------------\n";
cout << "Details of Employees";
cout<<"\n------------------------------------------------------------\n\n";

cout << "ID" <<setw(15)<<"Name" <<setw(10)<<"Age" <<setw(10)<<"Salary";
cout<<endl;
for(i=0;i<n;i++)
{

cout << "\n"<< Emp.Id <<setw(15)<< Emp.Name <<setw(10)<< Emp.Age <<setw(10)<< Emp.Salary;
}
cout<<"\n\n------------------------------------------------------------\n";

}
 
Last edited:
aYAZnpgju5EW+d8luHT7TmwSIA9QWJ3SgE3EO3Bf/v5BkHuZHlcctQalAoIdu6jZFoZMXGlJrvJPvcgjScWLzw==

^^decrypt

yan ba yun?., sa g8 in to pc yan.
 
Status
Not open for further replies.
Back
Top