Tuesday 10 March 2020

CPP program to work with the two pair classes

Source Code :
#include<iostream>
#include<utility>
using namespace std;
int main()
{
pair<string,string> number1("Suvadeep","983");
cout<<number1.first<<":"<<number1.second<<endl;
pair<string,int> student1("Soumyodeep",40);
cout<<student1.first<<":"<<student1.second<<endl;
return 0;
}

Program Output:

No comments:

Post a Comment