Question #223380

Create a function named DisplayNumberText to Display Number and Text input by user

Expert's answer

#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";
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS