#include<iostream>

#include<stack>

using namespace std;

int main(){
    //create a stack of Strings

    stack<string>languages;

    languages.push("java");
    languages.push("python");
    languages.push("c++");

    //print top element

    cout<<languages.top();

    // create second stack sring

    stack<string>cars;

    cars.push("hyundai");
    cars.push("bmw");
    cars.push("mercedes");

    cout<<cars.top();
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: