title: Clock Coordinates
body: <p>I am new to c programming and I had received an assignment not too long ago and ended up doing good enough (points were taken off for not using a for loop). Here is what is from my assignment. "Write a program that prompts the user for the radius of an analog clock, and then prints the x and y coordinates of the 12 hour marks for that clock.You may assume that the origin for the x and y axes is in the center of the clock" </p>
  
  <p>I was confused on how to use the for loop because I was trying to figure out a way how. I know it easy but I struggle with little things. This ended up to copy-pasting code, which led to massive amounts of code. I was wondering if I can get any hints on how to do this program with a for loop rather than having to write all this code Here is my code, but I will not display all of it because there is not point. (Also wondering if I do need arrays? Let me know that too, sorry for the weird format, I have not figured out how to make the code blend in).</p>
  
  <pre><code>int main () {
  float x [12];
  float y [12];
  float rad;
  int i, theta = 0;
  
  printf("Enter the radius of the clock\n");
  scanf("%f", &amp;rad);
  
  x[0] = rad * cos(90*M_PI/180);
  y[0] = rad * sin(90*M_PI/180);
  
  x[1] = rad * cos(60*M_PI/180);
  y[1] = rad * sin (60*M_PI/180);
  
  x[2] = rad * cos (30*M_PI/180);
  y[2] = rad * sin (30*M_PI/180);
  
  x[3] = rad * cos (0 * M_PI/180);
  y[3] = rad * sin (0* M_PI/180);
  
  x[4]= rad * cos (330*M_PI/180);
  y[4]= rad * sin (330*M_PI/180);
  
  x[5] = rad * cos (300*M_PI/180);
  y[5] = rad * sin (300*M_PI/180);
  
  x[6] = rad * cos (270*M_PI/180);
  y[6] = rad * sin (270*M_PI/180);
  
  x[7] = rad * cos (240*M_PI/180);
  y[7] = rad * sin (240*M_PI/180);
  
  x[8] = rad * cos (210*M_PI/180);
  y[8] = rad * sin (210*M_PI/180);
  
  x[9] = rad * cos (180*M_PI/180);
  y[9] = rad * sin (180*M_PI/180);
  
  x[10] = rad * cos (150*M_PI/180);
  y[10] = rad * sin (150*M_PI/180);
  
  x[11] = rad * cos (120*M_PI/180);
  y[11] = rad * sin (120*M_PI/180);
  
  printf("The x and y coordinates of the 12 o'clock mark are (%f , %f)\n", x[0], y[0]);
  </code></pre>
  
  <p>I use printf statement for all 12 arrays. </p>
  
  <p>The output is suppose to look like this "The x and y coordinates of the 12 o'clock mark are (0.000000 , 1.000000) and it changes depending on the radius." Thank you!</p>