You are on page 1of 1

#include <stdio.

h>

#include <conio.h>

int main()

float eng, isl, urdu, math, total_marks, percentage, average;

// Input marks for each subject

printf("Enter marks for English: ");

scanf("%f", &eng);

printf("Enter marks for Islamiat: ");

scanf("%f", &isl);

printf("Enter marks for Urdu: ");

scanf("%f", &urdu);

printf("Enter marks for Mathematics: ");

scanf("%f", &math);

total_marks = eng + isl + urdu + math;

percentage = (total_marks / 400) * 100;

average = total_marks / 4;

printf("\n\n\n");

printf("--------------MARKSHEET--------------\n");

printf("Subject\t\tMarks Obtained\n");

printf("-------------------------------------\n");

printf("English\t\t%.2f\n", eng);

printf("Islamiat\t%.2f\n", isl);

printf("Urdu\t\t%.2f\n", urdu);

printf("Mathematics\t%.2f\n", math);

printf("-------------------------------------\n");

printf("Total Marks\t%.2f/400\n", total_marks);

printf("Percentage\t%.2f%%\n", percentage);

printf("Average\t\t%.2f\n", average);

getch();

return 0;

You might also like