Write the definition of a function Alter(A, N) in python, which should change all the multiples of 5 in the list to 5 and rest of the elements as 0.
Write the definition of a function Alter(A, N) in python, which should change all the odd numbers in the list to 1 and even numbers as 0.
Write code for a function void oddEven (s, N) in python, to add 5 in all the odd values and 10 in all the even values of the list S.
Write a code in python for a function void Convert ( T, N) , which repositions all the elements of array by shifting each of them to next position and shifting last element to first position.
e.g. if the content of array is
0 1 2 3
10 14 11 21
The changed array content will be:
0 1 2 3
21 10 14 11
#---------------------------------------
'''
Write a code in python for a function Convert ( T, N) , which repositions
all the elements of array by shifting each of them to next position and shifting first
element to last position.
e.g. if the content of array is
0 1 2 3
10 14 11 21
The changed array content will be:
0 1 2 3
14 11 21 10
'''
#---------------------------------------
Write a function SWAP2BEST ( ARR, Size) in python to
modify the content of the list in such a way that the elements,
which are multiples of 10 swap with the value present in the very
next position in the list
#---------------------------------------
Write a function CHANGEO ,which accepts an list of integer and its size as parameters and divide all those list elements by 7 which are divisible by 7 and multiply list elements by 3.
#----------------------------------------
Write function which accepts an integer array and size as arguments and replaces elements having odd values with thrice its value and elements having even values with twice its value.
Example : if an array of five elements
initially contains elements as 3, 4, 5, 16, 9
The function should rearrange the content of the array as 9, 8, 15, 32,27
#-----------------------------------------
Write a function which accepts an integer array and its size as parameters and rearranges the array in reverse.
Example:
If an array of nine elements initially
contains the elements as 4, 2, 5, 1,6, 7, 8, 12, 10
Then the function should rearrange the array as
10, 12, 8, 7, 6, 1, 5, 2, 4
#---------------------------------------
Write a function which accepts an integer array and its size as arguments and swap the elements of every even location with its following odd location.
Example :
If an array of nine elements initially
contains the elements as
2,4,1,6,5,7,9,23,10
then the function should rearrange the
array as 4,2,6,1,7,5,23,9,10
#---------------------------------------
Write a Get2From1( ) function in to transfer the content from one list ALL[ ] to two list Odd[ ]and Even[]. The Even should contain values from places (0,2,4,………) of ALL[] and Odd[] should contain values from places ( 1,3,5,……….).