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 |
Name the different types of stl containers.
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 .
In what scenario does the Logical file and Physical file being used?
why does the execution of a c++ program start with main()???
What is the STL?
Is there any error below, its a code to delete all entires from a map #include <map> #include iostream.h int main() { int i =0; map <int, char> TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map<int, char> :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }
How stl is different from the c++ standard library?
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
what is a template?
2 Answers Amazon, BITS, IBS, Wipro,
how to use C++?
Explain when u will use Observer pattern and how u will implement in c++ .
Write a program in C/C++ to implement reader- writer problem