i have tried alot to solve this problem but my code is wrong so could any one help me!!
this the problem:
FirstName LastName
Ali Abdallah
Maged Sayyed
Soha Gad
Ahmed Baher
Salma Gamal
Store these values of first & last name for these persons then display it in western system (LastName then FirstName).
Hint: use 2D Array.
and this is my code:
# include <iostream>
#include <string.h>
using namespace std;
void main()
{char arr [5][2];
cout<<"plz enter 1st name last name"<<endl;
for (int i=0;i<5;i++)
{for (int j=0;j<2;j++)
cin>>arr[i][j];
}
cout<<"Names in western system are"<<endl;
for (int i=0;i<5;i++)
{
for (int j=0;j<2;j++)
cout<<arr[j][i]<<" ";
}
}
thnx