Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

help asp

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago