Subscribe for more such posts..

Dear Reader...
I hope u are like my posts. If so then please don't forget to like , share and follow my blog for more such posts ,also feel free to write suggestions in the comment box given over here.

Thank you...

Search This Blog

C program to Total and Average of 5 subjects marks.


#include <stdio.h>
void main() { int sub1 , sub2 , sub3 , sub4 , sub5 ; float total , average ; printf("Enter 5 subjects marks : "); scanf("%d %d %d %d %d" , &sub1 , &sub2 , &sub3 , &sub4 , &sub5); total = sub1 + sub2 + sub3 + sub4 + sub5; average = (sub1 + sub2 + sub3 + sub4 + sub5)/(5.0) ; printf("Total marks : %f\n" , total); printf("Average marks : %f\n" , average); }


No comments:

Post a Comment