Google Program to calculate sum,average and division of marks in C++ Language | Asp.Net,C#.Net,VB.Net,MVC,jQuery,JavaScipt,AJAX,WCF,Sql Server example

Program to calculate sum,average and division of marks in C++ Language

Introduction: In previous articles i explained the program for Else if ladder or multiple else if to check the day corresponding to number in C++ Language and Else if ladder to perform operation on two numbers based on operator and How to find greatest of three numbers using multiple if statement and Print table of entered number using For loop and How to find month name corresponding to number using switch case.

Description: In this article i have written a program to calculate the total marks of student ,average marks and based on average marks, it calculates the division using else-if ladder or we can say multiple else-if.
On run it will first prompt user to enter name,class,roll number and marks in each subject.Then it will calculate the total marks obtained,average of marks and division achieved by the student.

Implementation: Let's understand by creating the program

      char name[20];
      int roll,clas;
      float hindi,eng,math,sci,art,comp,total,avg;
      cout<<"Enter name of student:= ";
      cout<<"Enter class of student:=";
      cout<<"Enter rollno of student:=";
      cout<<"Enter marks in hindi:=";
      cout<<"Enter marks in english:=";
      cout<<"Enter marks in math:=";
      cout<<"Enter marks in science:=";
      cout<<"Enter marks in art:=";
      cout<<"Enter marks in computers:=";
      cout<<"\n************Student's Marks Record*************\n";
      cout<<"Student's name:="<<name;
      cout<<"\nRoll No:="<<roll;
      cout<<"\nMarks in Hindi:="<<hindi;
      cout<<"\nMarks in English:="<<eng;
      cout<<"\nMarks in Math:="<<math;
      cout<<"\nMarks in Science:="<<sci;
      cout<<"\nMarks in Art="<<art;
      cout<<"\nMarks in computer="<<comp;
      cout<<"\nTotal Marks:="<<total;
      cout<<"\nAverage Marks="<<avg;

   cout<<"\n Merit";
      else if(avg>=60)
       cout<<"\n First Division";
       else if(avg>=50)
           cout<<"\n Second Division";
           else if(avg>=35)
cout<<"\n Pass";
  cout<<"\n Fail";

  • Run the program using Ctrl+F9

Enter name of student:=Karan
Enter class of student:=12
Enter rollno of student:=18
Enter marks in hindi:=77
Enter marks in english:=67
Enter marks in math:=80
Enter marks in science:=75
Enter marks in arts=68
Enter marks in computer:=88

****************Student's Marks Record****************
Student's name:=Karan
Roll No:=18
Marks in Hindi:=77
Marks in English:=67
Marks in Math:=80
Marks in Science:=75
Marks in Art:=68
Marks in Computer:=88
Total Marks:=455
Average Marks:=75.83
First Division

Now over to you:

"If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google+, Twitter, Linked in and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox . Stay tuned and stay connected for more technical updates."


  1. Nice work... Keep it up :)

    1. Thanks Faisal for appreciating my work..stay connected and keep reading..:)


If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily..