Answer to Question #257993 in C++ for Kelvin Tito

Question #257993

Write a C++ program to illustrates how to read strings and numeric data


1
Expert's answer
2021-10-30T10:36:36-0400


#include <iostream>


using namespace std;


int main()
{
   string s;
   cout<<"\nEnter a string: ";
   //reading string data
   cin>>s;
   
   int num;
   cout<<"\nEnter a numerical data: ";
   //reading a numerical data
   cin>>num;
   
   cout<<"\nThe entered string is "<<s;
   cout<<"\nThe entered integer is "<<num;


    return 0;
}

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