Display the Student of Name , Roll_no & Marks in using of Constractor in C++.
#include<iostream>
using namespace std;
class student
{
public:
student(int roll_no,char name[50], float marks)
{
cout<<"student is roll no is :"<< roll_no<<endl;
cout<<"student is name is :"<< name<<endl;
cout<<"student is marks:"<< marks<<endl;
}
};
main()
{
student std1(123,"rajan",450);
}
OUTPUT :
student is roll no is : 123
student is name is :rajan
student is marks : 450
No comments:
Post a Comment