This program is written in C++ and concatenates two string variables Name1 and Name2 to form a new string fullName using the + operator. The final concatenated string is then printed to the console using the cout statement. The program begins by including the necessary header files. The iostream header file is required for input/output operations, while the string.h header file is used for manipulating strings.
Next, the program defines three string variables Name1, Name2, and fullName. Name1 is initialized to the value "Tutor ", Name2 is initialized to the value "Joes", and fullName is initially empty. The two string variables Name1 and Name2 are then concatenated using the + operator and the result is stored in the fullName variable. Finally, the program prints the concatenated string fullName to the console using the cout statement with a newline character (\n) at the beginning to start the output on a new line.
#include<iostream> #include<string.h> using namespace std; int main() { string Name1 = "Tutor "; string Name2 = "Joes"; string fullName = Name1+Name2; cout<<"\n"<<fullName; return 0; }To download raw file Click Here
Tutor Joes
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions