Home > Back-end >  To solve the question 6 a total of three small q
To solve the question 6 a total of three small q

Time:11-21

CodePudding user response:

 
//no nested
Double funcA (double x)
{
If (x & lt; 0)
{
Return the x;
}

If (x<10)
{
Return to 10 x;
}

Return x + 10;
}

//nested
Double funcB (double x)
{
If (x & lt; 0)
{
Return the x;
}
The else
{
If (x<10)
{
Return to 10 x;
}
The else
{
Return x + 10;
}
}
}

//branch
Double funcC (double x)
{
If (x & lt; 0)
{
Return the x;
}
Else if (x<10)
{
Return to 10 x;
}
The else
{
Return x + 10;
}
}
  • Related