Structs

Sort by

recency

|

245 Discussions

|

  • + 0 comments

    Here is Structs problem solution in c++ - https://programmingoneonone.com/hackerrank-structs-solution-in-cpp.html

  • + 0 comments

    It is not clear why there are such #include in the head preprocessor section. In my opinion, code template needs to be fixed to 2 #include dirrectives: string and iostream.

  • + 0 comments

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

  • + 0 comments

    My C++ code 😎😁

    #include <cmath>
    #include <cstdio>
    #include <vector>
    #include <iostream>
    #include <algorithm>
    using namespace std;
    
    /*
        add code for struct here.
    */
    
    typedef struct Student Student;
    struct Student {
        int age;
        int standard;
        string first_name;
        string last_name;
    };
    
    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 comments
    struct Student{
        int age,standard ;
        string first_name, last_name;
    };