Write C++ programming

0 comments

1- Write a C++ program that will ask the user to input a string.

  1. Yourprogramwilldecideifthatstringisapalindrome(itisastring that would read the same way forward and backward).You must use a bool function that would take a string parameter bool isPalindrome(string s){——}
  2. Ifitisnotaplaindromprintthestringandthebackwardstring separated by space.

2. Write a program that includes a function that takes 4 int parameters, doubles them and return the sum of the four numbers.

3. Write a program that includes a function that would permanently reverse a string passed to it. Your function must be a void function. Hint: The string should be passed by reference.

4- Write a bool function isPrime(int n) that decides whether n is prime or not prime.
5- Use the function in #4 in a wrapper function that calls it – the wrapper function should call primeSequence that takes an int x and prints all the prime numbers up to x.

You should test all your functions by calling them from main and passing user input.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}