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 Posted / 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 View All Answers
sir please send me bpcl previous question papers
What is a list in c++ stl?
What is the use of stl?
please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html
how to use C++?
How does an stl file work?
write a program to convert a decimal number in to its equivalent binary number?
What is a stl vector?
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
Why should a c++ programmer be interested in stl?
In what scenario does the Logical file and Physical file being used?
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.
what is template and type convertion
What is a standard template library (stl)?
What are the different types of stl containers?