Answer to Question #232320 in C++ for Micay

Question #232320
Write a C++ program that declares three arrays of char elements. The first two arrays are
initialized with string literal constants, "Please, enter your first name: " and "Hello, ", while the
third one is left uninitialized for the first name entered.
1
Expert's answer
2021-09-02T04:34:03-0400
#include <iostream>
using namespace std;


int main ()
{
  char arr1[] = "Please, enter your first name: ";
  char arr2[] = "Hello, ";
  char arr3 [80];
  cout << arr1;
  cin >> arr3;
  cout << arr2 << arr3 << "!";
  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