#include<iostream>
#include<conio.h>
using namespace std;
class Student{
private:
int marks;
public:
void setMarks(int a){
marks=a;
}
void getMarks(){
cout<<"marks of student is "<<marks<<endl;
}
};
int main(){
Student s1;
s1.setMarks(84);
s1.getMarks();
s1.setMarks(90);
s1.getMarks();
getch();
return 0;
}
#include<conio.h>
using namespace std;
class Student{
private:
int marks;
public:
void setMarks(int a){
marks=a;
}
void getMarks(){
cout<<"marks of student is "<<marks<<endl;
}
};
int main(){
Student s1;
s1.setMarks(84);
s1.getMarks();
s1.setMarks(90);
s1.getMarks();
getch();
return 0;
}
No comments:
Post a Comment