Question 6: Recommend/ Explain a program that takes the information of 40 students in following order Name: Father Name: Enrollment...

Free

60.1K

Verified Solution

Question

Electrical Engineering

Question 6: Recommend/ Explaina program that takes the information of 40 students in followingorder
Name:

Father Name:

Enrollment number:

Date of birth:

After taking the information of the students, it then displaysthe entered information.

Answer & Explanation Solved by verified expert
4.4 Ratings (938 Votes)

Code in C Language (using structures)   :  

#include
struct student {
char Stud_Name[20];
char Father_Name[20];
int Enroll_num;
char DOB[20];
} s[40];

int main() {
int i;
printf(\"Enter information of students:\n\");

// storing information
for (i = 0; i < 40; ++i) {
printf(\"Record number - %d\",i+1);
printf(\"\nEnter Student Name: \");
scanf(\"%s\", s[i].Stud_Name);
printf(\"Enter Father Name : \");
scanf(\"%s\", s[i].Father_Name);
printf(\"Enter Enrollment Number :\");
scanf(\"%d\", &s[i].Enroll_num);
printf(\"Enter DOB(example:04-06-1999) : \");
scanf(\"%s\", s[i].DOB);
printf(\"\n\");
}
printf(\"Displaying Information:\n\n\");

// displaying information
for (i = 0; i < 40; ++i) {
printf(\"Record number - %d\",i+1);
printf(\"\nStudent Name: \");
puts(s[i].Stud_Name);
printf(\"Father Name :\");
puts(s[i].Father_Name);
printf(\"Enrollment Number :\");
printf(\"%d\",s[i].Enroll_num);
printf(\"\nDate of birth :\");
puts(s[i].DOB);
printf(\"\n\");
}
return 0;
}


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students