Computer Science, asked by hania8711, 6 months ago

write a program in c++ that takes marks obtained by a student in five different subject find out the aggregate marks and percentage

Answers

Answered by madhujo4522
1

Explanation:

Program: 53

Write a program to calculate aggregate marks and percentage marks obtained by the student in five subjects. | Let Us C Solutions

#include<stdio.h>

#include<conio.h>

void main()

{

int hindi, math, english, science, art, total;

float percentage;

printf("Enter the marks of Hindi: ");

scanf("%d", &hindi);

printf("Enter the marks of Math: ");

scanf("%d", &math);

printf("Enter the marks of English: ");

scanf("%d", &english);

printf("Enter the marks of Science: ");

scanf("%d", &science);

printf("Enter the marks of Art: ");

scanf("%d", &art);

total = hindi+math+english+science+art;

percentage = total/5;

printf("\nAggregate marks: %d", total);

printf("\nPercentage marks: %0.2f %%",

Output:

Enter the marks of Hindi: 50

Enter the marks of Math: 50

Enter the marks of English: 50

Enter the marks of Science: 50

Enter the marks of Art: 60

Aggregate marks: 260

Percentage marks: 52.00 %

Hope this answer helps you

Similar questions