#include <iostream>
#include <string>
using namespace std;
void DisplayNumberText(int number,string text);
void main(){
int number;
string text;
cout<<"Enter number: ";
cin>>number;
cin.ignore();
cout<<"Enter text: ";
getline(cin,text);
DisplayNumberText(number,text);
cin>>number;
}
//function named DisplayNumberText to Display Number and Text input by user
void DisplayNumberText(int number,string text){
cout<<"Number: "<<number<<"\n";
cout<<"Text: "<<text<<"\n";
}
Comments
Leave a comment