by Dinesh Thakur Category: C Programming (Pratical)

In this program user will find out the average of students scores. To perform this action the required info and variables are essentials. Like user declare array type variable and float type that will contain the value to be declared. After that user ask to enter the value like subject marks in the end process user add all the scores and divide them all with total subjects to find out the average of students. And to use printing method shown out the result on the screen.

Problem Statement:

  1. Declaring variables.
  2. Collecting info about scores.
  3. Using average finding method.
  4. Display result on the screen.

Here is C source code for finding average of students. The output of this program shown below. 

 

#include <stdio.h>
void main( )
{
       char name[20];
       float score1 , score2, score3, avg;
       clrscr();
       printf("Please Enter your name : "  ) ;
       scanf("%s" , name);
       printf("P1ease Enter the First Score : " ) ;
       scanf("%f",&score1);
       printf("P1ease Enter the Second Score : " ) ;
       scanf ( "%f",&score2);
       printf("P1ease Enter the Third Score : " ) ;
       scanf ("%f" , &score3);
       avg = (score1+score2+score3)/3;
       printf ("\n\nName: %-s\n\n", name);
       printf("Score 1: %-5.1f\n" , score1 ) ;
       printf("Score 2: %-5.1f\n" , score2);
       printf("Score 3: %-5.1f\n" , score3);
       printf("Average: %-5.1f\n\n", avg);
       getch();

Averaging Student Exam Scores



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.