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



wap in c++ which accept a integer array and its size as argument and replaces element having even..

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

Post New Answer

More STL Interview Questions

What are the different types of stl containers?

0 Answers  


What is a stl vector?

0 Answers  


What does stl mean in slang?

0 Answers  


How does an stl file work?

0 Answers  


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

0 Answers  


What is stl in c++ with example?

0 Answers  


Write a program to print the swapping in two no and using three variable.

5 Answers   Broadridge,


what is the difference between thread and process

1 Answers   Infosys,


WHAT IS FIBONACCI SERIES?

4 Answers   Stewart,


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

1 Answers  


Who wrote stl?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN C++ AND VC++

1 Answers   Syntel,


Categories