Design a form to accept the name of the
student and marks in 5 subjects - Calculat
the average marks obtained and display
the student gerade as follows:
Answers
Answer:
Explanation:
#include <stdio.h>
//defining structure
struct Marks {
int roll_no;
char name[30];
float chem_marks, maths_marks, phy_marks;
};
//main function
int main() {
struct Marks marks[5];
//Getting user input for info of the 5 students
for(int i=0; i<4; i++){
printf("Student %d\n",i+1);
printf("Enter roll no. :\n");
scanf("%d", &marks[i].roll_no);
printf("Enter name :\n");
scanf("%s",marks[i].name);
printf("Enter Chemistry marks :\n");
scanf("%f", &marks[i].chem_marks);
printf("Enter Maths marks :\n");
scanf("%f", &marks[i].maths_marks);
printf("Enter Physics marks :\n");
scanf("%f", &marks[i].phy_marks);
}
// Calculating and printing percentage for each student
for(int i=0; i<4; i++) {
printf("Student %d\n",i+1);
float percentage = (marks[i].chem_marks + marks[i].maths_marks + marks[i].phy_marks)/300.0*100;
printf("Percentage : %f\n", percentage);
}
return 0;
}
Answer:
In physics, power is the rate of doing work. It is the amount of energy consumed per unit time. The unit of power is the joule per second (J/s), known as the watt (in honor of James Watt, the eighteenth-century developer of the steam engine)