wap in c++ which accept a integer array and its size as
argument and replaces element having even values with its
half and element having odd values with twice its value
Answer / ashish
void update(int arr[], int size)
{
for(int i =0;i<size;i++)
{
if(arr[i]%2) arr[i] *= 2;
else arr[i] /= 2;
}
}
Is This Answer Correct ? | 14 Yes | 11 No |
What are the different types of stl containers?
What is a stl vector?
What does stl mean in slang?
How does an stl file work?
Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister
What is stl in c++ with example?
Write a program to print the swapping in two no and using three variable.
what is the difference between thread and process
WHAT IS FIBONACCI SERIES?
wap in c++ which accept a integer array and its size as argument and replaces element having even values with its half and element having odd values with twice its value
Who wrote stl?
WHAT IS THE DIFFERENCE BETWEEN C++ AND VC++