answersLogoWhite

0

What is taking damage c plus plus?

User Avatar

Anonymous

12y ago
Updated: 8/20/2019

// Taking Damage

// Demonstrates function inlining

#include

<iostream>

int

radiation(int health);

using

namespace std;

int

main()

{

int health = 80;

cout <<

"Your health is " << health << "\n\n";

health = radiation(health);

cout <<

"After radiation exposure your health is " << health << "\n\n";

health = radiation(health);

cout <<

"After radiation exposure your health is " << health << "\n\n";

health = radiation(health);

cout <<

"After radiation exposure your health is " << health << "\n\n";

return 0;

}

inline

int radiation(int health)

{

return (health / 2);

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions