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

sir please send me bpcl previous question papers

2333


What is a list in c++ stl?

1117


What is the use of stl?

1044


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

2203


how to use C++?

2488


How does an stl file work?

1095


write a program to convert a decimal number in to its equivalent binary number?

2570


What is a stl vector?

1157


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

2320


Why should a c++ programmer be interested in stl?

1030


In what scenario does the Logical file and Physical file being used?

2777


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

2113


what is template and type convertion

2415


What is a standard template library (stl)?

1065


What are the different types of stl containers?

1075