We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. Prepare
  2. C++
  3. Classes
  4. Structs
  5. Discussions

Structs

Problem
Submissions
Leaderboard
Discussions

Sort 229 Discussions, By:

recency

Please Login in order to post a comment

  • dyum429
    2 weeks ago+ 0 comments
    #include <iostream>
    using namespace std;
    
    struct Student{
        int age,standard;
        string first_name, last_name;
    };
    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
        Student student;
        cin >> student.age >> student.first_name >> student.last_name>> student.standard;
        cout << student.age << " " << student.first_name << " " << student.last_name << " " << student.standard << endl;
        return 0;
    }
    
    0|
    Permalink
  • ivanreeve
    4 weeks ago+ 0 comments
    struct Student{
        string first_name, last_name;
        int age, standard;
    };
    
    0|
    Permalink
  • prabhaths2001
    1 month ago+ 0 comments
    struct Student{
        int age;
        string first_name;
        string last_name;
        int standard;
    };
    
    0|
    Permalink
  • zacksunrise32
    1 month ago+ 0 comments

    include

    include

    include

    include

    include

    using namespace std;

    struct Student{ int age; string first_name; string last_name; int standard;

    };

    int main() {

     Student st;
    
    cin >> st.age >> st.first_name >> st.last_name >> st.standard;
    cout << st.age << " " << st.first_name << " " << st.last_name << " " << st.standard;
    
    return 0;
    

    }

    0|
    Permalink
  • jyotirmoydasapd1
    1 month ago+ 0 comments

    include

    include

    include

    include

    include

    using namespace std;

    class student{
    public:
    int age;
    string fname;
    string lname;
    int standard;
    

    };

    int main() { student s;

    cin>> s.age >> s.fname >> s.lname >> s.standard;
    
    cout<< s.age <<" "<< s.fname << " "<< s.lname <<" "<< s.standard;
    
    return 0;
    

    }

    0|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy