Skip to content
Physics and Astronomy
Home Our Teaching Resources C programming silly1.html
Back to top

A silly example

These two fragments of code both calculate the distance from the origin of a point on a plane with gradient 1 in both the x and y directions, but one is much clearer than the other:

Clear

 

Unclear

 
Log in
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Privacy & cookies Share
Back to top