Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

2294


What is stl in oop?

1267


What are the various types of stl containers?

1240


What is the use of stl?

1134


What is stl stack?

1201


how to use C++?

2610


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

2229


Define stl.

1329


What is meant by stl in c++?

1209


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2684


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

2582


Is there any error below, its a code to delete all entires from a map #include #include iostream.h int main() { int i =0; map TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }

2433


Who wrote stl?

1186


draw a flowchart that accepts two numbers and checks if the first is divisible by the second.

3429


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

2265