This is a division function which divides two integers, y by x. The major flaws in the design of this algorithm are that it only works with positive integers and that it allows division by zero which should always be undefined. To fix this first I would add a check to the top to see whether x is zero, throw and exception or do some form of error handling depending on the language but force the function to return as it should not be able to continue. Then absolute value both x and y and proceed normally. Finally before returning z, check to see whether x and y are negative, one is negative, or neither are negative. If only one is negative multiple z by -1 and save it back in z to change the sign. Then allow z to be returned.
In all reality however this is still not a great solution because there are many, much more efficient ways to do this and most architectures, if not all, have built in opcodes for handling division.
I'm not entirely sure what you mean by networking, however I've done a fair amount of work with the C Sockets API (C++ uses this also unless you are using a 3rd party library). I do have some code I've written that does network communications (both server and client). I've never written Windows socket code but as far as I know the only major difference is that you must make the call to winsock and there is no fork() so you need to either use threads for handling multiple connections or whatever Windows's semi-equivalent method of spawning a child is.
In all reality however this is still not a great solution because there are many, much more efficient ways to do this and most architectures, if not all, have built in opcodes for handling division.
I'm not entirely sure what you mean by networking, however I've done a fair amount of work with the C Sockets API (C++ uses this also unless you are using a 3rd party library). I do have some code I've written that does network communications (both server and client). I've never written Windows socket code but as far as I know the only major difference is that you must make the call to winsock and there is no fork() so you need to either use threads for handling multiple connections or whatever Windows's semi-equivalent method of spawning a child is.