Structure Example 1 – C++ Language

#include <iostream>

using namespace std;
struct student
{
char name[5];
};
int main()
{
struct student a;
cout<<“Enter the name of students”<<endl;
for(int i=1;i<=5;i++)
{
cin>>a.name[i];
}
cout<<“student names are”<<endl;
for(int j=1;j<=5;j++)
{
cout<<a.name[j]<<endl;
}
return 0;
}