Preserving a Simultaneous Update

A supplied mass-transfer calculation specifies the following simultaneous updates for masses in kilograms:


anew=0.80aold+0.10bold,bnew=0.20aold+0.90bold.\begin{aligned} a_{\text{new}}&=0.80a_{\text{old}}+0.10b_{\text{old}},\\ b_{\text{new}}&=0.20a_{\text{old}}+0.90b_{\text{old}}. \end{aligned}


Initially, C variables a and b have type double and contain 12.0 kg and 8.0 kg, respectively. Both equations must use the values from before the update. Which block correctly implements one simultaneous update?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Implementation of Algorithms Using C Questions: