answersLogoWhite

0

#include //#include #define STU 3 #define SUB 3 void main() { int k,i; struct student { int rno; char name[20]; int marks[2]; int total; float avg; }sk; for(k=1;k<=STU;k++) { printf("Enter the roll no and name of the student %d:",k); scanf("%d%s",&sk.rno,&sk.name); printf("Enter the marks:"); for(i=0;i"%d",&sk.marks[i]); sk.total=sk.total+sk.marks[i]; } sk.avg=sk.total/SUB; } printf("\nRollno\tName\tMarks\tTotal\tAvg\n"); for(k=1;k<=STU;k++) { printf("%d\t%s\t",sk.rno,sk.name); for(i=0;i"%d ",sk.marks[i]); printf("%d\t%.3f\n",sk.total,sk.avg); } //getch(); }

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

Write a program in c to sort the details of 10 students using the structure?

for(i = 0; i &lt; num_students; i ++){ sort(student[i]); } That's what you get when you're that specific!


Write a program to find the grade obtained by the students of a class using structure?

Write a program to find the grade obtained by the students of a class


How do you write a c program to perform students details and information of highest scorer using structure and pointers?

To write a C program that handles student details and identifies the highest scorer using structures and pointers, first, define a structure to hold student information, such as name and score. You can then create an array of these structures and use a pointer to traverse the array to find the student with the highest score. Use a loop to compare scores and keep track of the pointer to the highest scorer. Finally, display the details of that student. Here's a simplified example: #include &lt;stdio.h&gt; #include &lt;string.h&gt; struct Student { char name[50]; int score; }; int main() { struct Student students[5], *highest = NULL; for (int i = 0; i &lt; 5; i++) { printf(&quot;Enter name and score for student %d: &quot;, i+1); scanf(&quot;%s %d&quot;, students[i].name, &amp;students[i].score); } highest = &amp;students[0]; for (int i = 1; i &lt; 5; i++) { if (students[i].score &gt; highest-&gt;score) { highest = &amp;students[i]; } } printf(&quot;Highest Scorer: %s with score %d\n&quot;, highest-&gt;name, highest-&gt;score); return 0; }


How do you write a program in C that will captures details The details to be captured are student name mark and age The program should calculate and display the average marks for all the students?

Create a data structure to store the details for each student: typedef struct student_t { char name[30]; unsigned age; unsigned mark; } student; Establish an array to store the student data: size_t max = 100; // replace 100 with the actual number of students student students[max]; Use a loop to enter the data: for (size_t i=0; i&lt;max; ++i) { printf ("Student name: "); scanf ("%s", students[i].name); printf ("Student age: "); scanf ("%u", students[i].age); printf ("Student mark: "); scanf ("%u", students[i].mark); } Calculate and display the average mark: unsigned sum = 0; for (size_t i=0; i&lt;max; ++i) sum += student[i].mark; printf ("Average mark: %d\n", sum / max_students);


Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.

Related Questions

Write a program in c to sort the details of 10 students using the structure?

for(i = 0; i &lt; num_students; i ++){ sort(student[i]); } That's what you get when you're that specific!


Write a program to find the grade obtained by the students of a class using structure?

Write a program to find the grade obtained by the students of a class


Is it possible to write a complete program using only a decision structure?

No, you can use a decision structure to test a condition in any part of the program and execute some action based on the outcome but you cannot use a decision structure alone to write a complete program.


How do you write a c program to perform students details and information of highest scorer using structure and pointers?

To write a C program that handles student details and identifies the highest scorer using structures and pointers, first, define a structure to hold student information, such as name and score. You can then create an array of these structures and use a pointer to traverse the array to find the student with the highest score. Use a loop to compare scores and keep track of the pointer to the highest scorer. Finally, display the details of that student. Here's a simplified example: #include &lt;stdio.h&gt; #include &lt;string.h&gt; struct Student { char name[50]; int score; }; int main() { struct Student students[5], *highest = NULL; for (int i = 0; i &lt; 5; i++) { printf(&quot;Enter name and score for student %d: &quot;, i+1); scanf(&quot;%s %d&quot;, students[i].name, &amp;students[i].score); } highest = &amp;students[0]; for (int i = 1; i &lt; 5; i++) { if (students[i].score &gt; highest-&gt;score) { highest = &amp;students[i]; } } printf(&quot;Highest Scorer: %s with score %d\n&quot;, highest-&gt;name, highest-&gt;score); return 0; }


How do you write a program in C that will captures details The details to be captured are student name mark and age The program should calculate and display the average marks for all the students?

Create a data structure to store the details for each student: typedef struct student_t { char name[30]; unsigned age; unsigned mark; } student; Establish an array to store the student data: size_t max = 100; // replace 100 with the actual number of students student students[max]; Use a loop to enter the data: for (size_t i=0; i&lt;max; ++i) { printf ("Student name: "); scanf ("%s", students[i].name); printf ("Student age: "); scanf ("%u", students[i].age); printf ("Student mark: "); scanf ("%u", students[i].mark); } Calculate and display the average mark: unsigned sum = 0; for (size_t i=0; i&lt;max; ++i) sum += student[i].mark; printf ("Average mark: %d\n", sum / max_students);


Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.


Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50 percent in the test. Make necessary assumptions?

Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50% in the test. Make necessary assumptions


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Write a c program to generate student mark details using union and find total and average and grade?

write a c program to display marks,total,average,grade using union


How can write a c program to store students record in a file?

Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo,


Do students like to write?

Yes students do like to write.


What does a college English course usually teach?

A college English course usually teaches students about sentence structure. These classes help students write better sentences and have an extensive vocabulary.