C++ Programming Blog

 
 
 
#include<iostream.h>
#include<conio.h>
class data
{
    int rollno,maths,science;
    int avg();
    public:
        void getdata();
        void putdata();
};

main()
{
    clrscr();
    data stud[5];
    for(int i=0;i<5;i++)
        stud[i].getdata();
}

void data::getdata()
{
    cout<<\"Please enter rollno:\";
    cin>>rollno;
    cout<<\"Please enter maths marks:\";
    cin>>maths;
    cout<<\"Please enter science marks:\";
    cin>>science;
    putdata();
}

int data::avg()
{
    int a;
    a=(maths+science)/2;
    return a;
}

void data::putdata()
{
    cout<<\"Average is :\"<<avg()<<endl;
}

    Related Post:
  1. Program to do variable replacement in a line of text

  2. Program to read n integers and add them up and output the result

  3. Program to read a Linear System of Equations,then evaluate it by using Gauss-Elimination Method and show the result

  4. Program to show the projection of 3D objects using Cavalier Oblique Parallel Projection onto xy-plane (i.e. angle=45 deg)

  5. Program to illustrate the implementation of X-Direction Shear Transformation

  6. Program to read a Non-Linear equation in one variable, then evaluate it using Simple Itrative Method and display its kD accurate root

  7. Program to show the implementation of Bottom-Up Parsing

  8. Program of calculator

  9. Program to show the implementation of None-or-All String Clipping Strategy (Text Clipping Example)

  10. Program to show the implementation of Cohen-Sutherland Line Clipping Algorithm

  11. Program that reads 10 students marks and displays average, lowest and highest marks

  12. Program of Shortest Path for Given Source and Destination (using Dijkstras Algo.)

  13. Program that will read a token from a user and find its type

  14. PROGRAM FOR ACCEPTING MEASUREMENTS IN METERS AND FEETS AND SUMMING THEM UP IN THE FORMAT THAT THE USER WISHES

  15. Program to generate a triangular wave form according to a specified pair of Amplitude and Frequency

  16. Program to draw a circle using Bresenhams Circle Algorithm

  17. Program to illustrate the implementation of 3D Rotation Transformation along y-axis

  18. Program to convert a Postfix Expression into an Infix Expression

  19. Program to illustrate static member functions

  20. Program to estimate the value of Second Derivative of the function at the given points from the given data using Central Difference Formula of order 2