test

Page 56

int temp = n2;

// Set n1 and n2 to the next two Fibonacci numbers. n1 += n2; n2 = temp + n1; } // The following code prints the following output: // 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, int x = 1; int y = 1;

for(int i = 1, i < 11, i += 2) { Console.Write("{0}, {1}", x, y); FibonacciIncrement(x, y); } FibonacciIncrement accepts the last two numbers and then returns the next two numbers in the series. Here are the request and response messages for the first call to FibonacciIncrement: <!-- Request Message --> <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <FibonacciIncrement> <n1>1</n1> <n2>1</n2> </FibonacciIncrement> </soap:Body> </soap:Envelope>

<!-- Request Message --> <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <FibonacciIncrementResponse> <n1>2</n1> <n2>3</n2>

56


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.