0% found this document useful (0 votes)
10 views2 pages

New Text Document

Uploaded by

mabrouki amine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

New Text Document

Uploaded by

mabrouki amine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<iostream>

#include<string>
using namespace std;

struct stperson
{
string FirstName;
string LastName;
int Age;
int Phone;
};

void ReadInfo(stperson Person)


{
cout << "firstname ?" << endl;
cin >> Person.FirstName;
cout << "lastname ?" << endl;
cin >> Person.LastName;
cout << "age ?" << endl;
cin >> Person.Age;
cout << "phone ?" << endl;
cin >> Person.Phone;
}

void PrintInfo(stperson Person)


{
cout << "*****************************" << endl;
cout << "FirstName : " << Person.FirstName << endl;
cout << "LastName : " << Person.LastName << endl;
cout << "Age : " << Person.Age << endl;
cout << "Phone : " << Person.Phone << endl;
cout << "********************************" << endl << endl;
}

void ReadPersonInfo(stperson Person[100],int& NbreOfPerson)


{
cout << "How many person ?" << endl;
cin >> NbreOfPerson;
for (int i = 0; i <= NbreOfPerson - 1; i++)
{
cout << endl << "PersonInfo " << i + 1 << endl;
ReadInfo(Person[i]);
}
}

void PrintPersonInfo(stperson Person[100], int NbreOfPerson)


{
for (int i = 0; i <= NbreOfPerson-1; i++)
{
cout << endl << "PersonInfo " << i + 1 << endl << endl;
PrintInfo(Person[i]);
}
}

int main()
{
stperson Person[100];
int length;
ReadPersonInfo(Person, length);
PrintPersonInfo( Person,length);

return 0;
}

You might also like