Question: write a c++ program for the following question Recursion An integer. Determine whether the number you entered a Palindrome (read equally both from left to

write a c++ program for the following question

"Recursion"

An integer. Determine whether the number you entered a Palindrome (read equally both from left to right and from right to left).

Problem using recursion. NB: the solution should be in the form as shown in an example below:

#define _CRT_SECURE_NO_WARNINGS

#include

#include

#include

using namespace std;

void func(int *a, int n)

{

for (int i = 0; i < n; i++)

if (a[i] < 0) a[i] = 0;

}

int main()

{

int *a;

int n;

srand(time(NULL));

printf("n= ");

scanf("%d", &n);

a = (int*)malloc(n*sizeof(int));

for (int i = 0; i

a[i] = rand() % 201 -100;

for (int i = 0; i

printf("%3d ", a[i]);

func(a, n);

printf(" ");

for (int i = 0; i

printf("%3d ", a[i]);

getchar(); getchar();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!