FIFA-2022 Career Guide Free Tutorials Go to Your University Placement Preparation 
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

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs


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


Free Online Directory