Write a program to print "My First C++ Program
Answers
Answered by
0
Answer:
>>> string = "This is Python Programming."
>>> string.replace(" ", "-")
'This-is-Python-Programming.'
replace() is a function that enables programmers to replace a character, with another character. Its syntax is as follows:
variable_name.replace("existing character", "new character")
A few more examples:
str1 = "Hello and Welcome!"
str1.replace(" ", "#")
Hello#and#Welcome!
str2 = "I hate Python Programming"
str2.replace("hate", "love")
I love Python Programming
Answered by
1
Language:
C++
Program:
#include <iostream>
using namespace std;
int main ()
{ cout << "My First C++ Program";
return 0; }
Output:
Consider the attachment.
Explanation:
- cout returns the output on the screen.
Attachments:
Similar questions