Good Afternoon
12:36 pm

Sponsor Area

Sponsor Area

Question is

Write the definition of a function Alter(int A[], int N) in C++, which should change all the multiples of 5 in the array to 5 and rest of the elements as 0. For example, if an array of 10 integers is as follows:

A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9]
55 45 20 16 39 90 83 40 48 25

After executing the function, the array content should be changed as follows:

A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9]
5 0 5 0 0 5 0 5 0 5

Mock Test Series

Sponsor Area

Sponsor Area

NCERT Book Store

NCERT Sample Papers

Entrance Exams Preparation