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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started