Showing posts with label Cartesian Coordinates. Show all posts
Showing posts with label Cartesian Coordinates. Show all posts

Function should print the cartesian coordinates of the struct argument

How to write a function should print the cartesian coordinates of the struct argument in C Programming Language ?



  1. /*This function should print the cartesian coordinates of the struct argument*/
  2. void printCartesian(struct cartesian_t n){
  3.         printf("Result in cartesian:");
  4.         printf("%.3f ", n.x);
  5.         if ((n.y) >= 0){
  6.                 printf("+");
  7.         }
  8.         else{}
  9.         printf("%.3f \n", n.y);
  10. }