Answer to Question #223380 in C++ for enKay

Question #223380
Create a function named DisplayNumberText to Display Number and Text input by user
1
Expert's answer
2021-08-04T14:10:47-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS