CPP/++ program to create a Student class.

#include<iostream>
using namespace std;
class student{
public:
    int roll;
    float marks;
    void input()
    {
        cout<<“Enter roll and marks:”<<endl;
        cin>>roll>>marks;
    }
    void show()
    {
        cout<<“Student’s roll and marks are:”<<endl;
        cout<<roll<<”  and “<<marks;    }
};
int main()
{
student s1;
s1.input();
s1.show();
return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>