google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 write a program to display student data using structure - 2nd puc computer science

write a program to display student data using structure

 /* Write a program to input the register number, name and class of all the students in a class into a structure and output the data in a tabular manner with proper heading */

#include<iostream.h>

#include<conio.h>

void main()

{

struct student

{

int regno;

char name[25];

char section[10];

};

student s[50];

int i,n;

clrscr();

cout<<"How many students? ";

cin>>n;

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

{

cout<<"Enter the register number of the student "<<i+1<<":";

cin>>s[i].regno;

cout<<"Enter the name of the student "<<i+1<<":";

cin>>s[i].name;

cout<<"Enter the section of the student "<<i+1<<":";

cin>>s[i].section;

}

cout<<"REGNO\tNAME\tSECTION\n";

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

cout<<s[i].regno<<"\t"<<s[i].name<<"\t"<<s[i].section<<endl;

getch();

}

write a program to display student data using structure write a program to display student data using structure Reviewed by Vision Academy on March 03, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.