fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. class Student{
  4. private:
  5. int roll;
  6. string name;
  7. float cgpa;
  8.  
  9.  
  10. public:
  11. Student(){
  12. roll=21134;
  13. name=" Fahim";
  14. cgpa= 3.98;
  15. }
  16. void show(){
  17. cout<<"Name:"<<name<<endl;
  18. cout<<"Roll:"<<roll<<endl;
  19. cout<<"CGPA:"<<cgpa<<endl;
  20. }
  21. };
  22. int main(){
  23. Student obj;
  24. obj.show();
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5248KB
stdin
Standard input is empty
stdout
Name: Fahim
Roll:21134
CGPA:3.98