0% found this document useful (0 votes)
77 views2 pages

C Basic Students Marks Project

The document is a C program that calculates the total marks, average, and percentage of a student based on their scores in five subjects. It prompts the user to input the student's name and marks, computes the total and percentage, and determines if the student has passed or failed based on a threshold of 50%. The program outputs the results including total marks, average, and pass/fail status.

Uploaded by

Hacker Gudu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views2 pages

C Basic Students Marks Project

The document is a C program that calculates the total marks, average, and percentage of a student based on their scores in five subjects. It prompts the user to input the student's name and marks, computes the total and percentage, and determines if the student has passed or failed based on a threshold of 50%. The program outputs the results including total marks, average, and pass/fail status.

Uploaded by

Hacker Gudu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

int main()

{
char student_name[20];
int maths;
int chemistry;
int physics;
int english;
int hindi;
int total;
const int total_marks=500;
float Average;
float percentage;
const int P=100;
printf("Let check out the results of students. \n");
printf("\n");
printf("Enter the name of the student. \n");
scanf("%s",&student_name);
printf("enter the marks of maths:- \n");
scanf("%d",&maths);
printf("enter the marks of chemistry:- \n");
scanf("%d",&chemistry);
printf("enter the marks of physics:- \n");
scanf("%d",&physics);
printf("enter the marks of english:- \n");
scanf("%d",&english);
printf("enter the marks of hindi:- \n");
scanf("%d",&hindi);
total = maths+chemistry+physics+english+hindi;
printf("the total number are %d out of 500",total);
printf("\n");
printf("\n");
printf("The total marks of all subject is:- %d \n",total_marks);
Average = (float)total/total_marks;
printf("\n");
printf("The Average of Marks is = %f",Average);
printf("\n");
printf("\n");
printf("the total number which you had gain out of 500 to get a percentage. \n");
printf("\n");
percentage = Average * P;

printf("The percentage of marks is:- %f \n",percentage);


printf("\n");
if(percentage<50){
printf("Fail");
}else{
printf("Pass");
}

return 0;
}

You might also like