void main( )
{
int avg, sum = 0;
int marks[10];
for (int i = 0; i<=9; i++ )
{
printf ( “\n Please enter marks for 10 students: ” );
scanf ( “%d”, &marks[i] );
}
for (i = 0; i<=9; i++)
sum = sum + marks[i];
avg = sum / 20;
printf ( “\n Total marks secured by 10 students in a test are %d”, sum);
printf ( “\n Average marks secured by 10 students in a test are %d”, avg);
}
C Programming,C Objective,Advanced C/C++ Programming,C++ Programming,Linux System Programming,RTOS,Interview Questions,Multimedia,Stagefright,Android Application Programming
My Blog List
Write a C program to calculate the total and average of marks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment