SUMMER TRAINING Free Tutorials  Go To Your University  Placement Preparation 
Project Based Best Summer Training Courses in Jaipur
Join our Telegram Channel To take free Online Courses
0 like 0 dislike
in GTU B.E. (CSE-I-Sem) Programming For Problem Solving Lab by Goeduhub's Expert (7.1k points)

Design a structure student_record to contain name, branch and total marks obtained. Develop a program to read data for 10 students in a class and print them.

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.1k points)
edited by
Best answer

In this program we are going to implement a structure called student_record. It contains member variables as student name, branch name, total marks.

To learn about structure and union from beginning Click Here.

Example :


//Declaration of structure student_record
struct student_record{

//Member variables of student_record
char student_name[30],branch_name[30];
int total_marks;

void main()
int i,n;

//Number of students to include
printf("\nEnter the number of students you want to include:");

//Student information
printf("\nEnter the following information related to students");
printf("\nStudent %d Name:",i+1);
printf("\nBranch Name:");
printf("\nTotal Marks:");

//Printing student information on output window
printf("\nEntered Information:");
printf("\n|| S.No. ||  Student Name      ||    Branch Name    ||   Total Marks  ||");
printf("\n||  %d    ||   %s             ||       %s        ||          %d     ||",i+1,student[i].student_name,student[i].branch_name,student[i].total_marks);

Output :

Output of above program showing structure operation

For More GTU C Programming Lab Experiments Click Here

Our Mentors(For AI-ML)

Sharda Godara Chaudhary

Mrs. Sharda Godara Chaudhary

An alumna of MNIT-Jaipur and ACCENTURE, Pune


Ms. Nisha

An alumna of IIT-BHU

Related questions


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  |