- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Environmental Science
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to calculate sum of 5 subjects and find percentage Using C Program
C Program to calculate sum of 5 subjects and find percentage
#include <stdio.h>
int main() {
int s1, s2, s3, s4, s5, sum, total = 500;
float per;
printf("\nEnter marks of 5 subjects : ");
scanf("%d %d %d %d %d", &s1, &s2, &s3, &s4, &s5);
sum = s1 + s2 + s3 + s4 + s5;
printf("\nSum : %d", sum);
per = (sum * 100) / total;
printf("\nPercentage : %f", per);
return (0);
}
Output :
Enter marks of 5 subjects : 80 70 90 80 80
Sum : 400
Percentage : 80.00
- Related Questions & Answers
- How to find area and circumference of circle using C Programming
- How to check the type of triangle using C
- Top 50 Programming Interview Questions & Answers (2021)
- How to calculate sum of 5 subjects and find percentage Using C Program
- How to Solve Second Order Quadratic Equation Using C Program
- How To Clean Up Unnecessary Code From WordPress Header Without Plugins
- Write C Program to Reversing an Array Elements in C Programming
- Write C program to find Exponent Power Series
- Write C Program to Merge Two arrays in C Programming
- How to make a chain of function decorators in Python?
- What are Python function attributes?
- Find Second largest element in an array using C Programming
- How to Calculate Area of Equilatral Triangle using C Language
- How to print hello world using C Language
- Write a ‘C’ Program to compute the sum of all elements stored in an array using pointers
- How To Send mail from your Gmail account using Python
Advertisements
ads