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

Can we use stl in coding interviews?

0 Answers  


Who wrote stl?

0 Answers  


Define the terms: field, record, table and database

5 Answers  


Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .

4 Answers   Zycus Infotech,


Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.

0 Answers  






Assume I have a linked list contains all of the alphabets from "A" to "Z?" I want to find the letter "Q" in the list, how does you perform the search to find the "Q?"

2 Answers  


Is stl part of c++ standard?

0 Answers  


write a c++ to define a class box with length,breadth and height as data member and input value(),printvalue() and volume() as member functions.

3 Answers  


write a program that input four digit number and find how many 7 that number contains

4 Answers  


how to overload << and >> operator in c++

3 Answers   Wipro,


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  


Explain stl.

0 Answers  


Categories