Skip to content

Instantly share code, notes, and snippets.

@LokeshKumarES
Created September 13, 2018 16:16
Show Gist options
  • Save LokeshKumarES/67e690f55e065e269d6cfd67f5757127 to your computer and use it in GitHub Desktop.
Save LokeshKumarES/67e690f55e065e269d6cfd67f5757127 to your computer and use it in GitHub Desktop.
Write a C program to find the sum and percentage of marks.
#include<stdio.h>
#include<conio.h>
void main()
{
int ma, en, ph, ch, cs;
float sum, per;
printf("Enter the marks of Maths= ");
scanf("%d", &ma);
printf("Enter the marks of English= ");
scanf("%d", &en);
printf("Enter the marks of Physics= ");
scanf("%d", &ph);
printf("Enter the marks of Chemistry= ");
scanf("%d", &ch);
printf("Enter the marks of Computer_Science= ");
scanf("%d", &cs);
sum = ma+en+ph+ch+cs;
per=(sum)/5;
printf("The Percentage marks obtained= %f", per);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment