fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. class student{
  5. public:
  6. string name;
  7. string dept;
  8. string course;;
  9. float gpa;
  10. };
  11. int main(){
  12. student a;
  13. a.name="Ahmed";
  14. a.dept="CSE";
  15. cin>>a.course;
  16. a.gpa=3.5;
  17. student b;
  18. a.name="Ahma";
  19. a.dept="CSE";
  20. cin>>a.course;
  21. a.gpa=10.0;
  22. cout<<a.name<<"";
  23.  
  24. }
  25.  
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
Ahma