title: calculation of wall clock
body: <p>How to modify this code to do sequential
  program to calculate the wall clock time
  (time_t) needed to calculate the dot product
  of the complex numbers.</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;stdlib.h&gt;
  #include&lt;stdio.h&gt;
  
  typedef struct complex{
  double real;
  double img;
  }complex;
  
  complex add(complex a, complex b);
  complex multiply(complex *a, complex *b);
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
  int choice, temp1, temp2;
  complex a, b, c;
  
  while (1)
  {
      printf("Press 1 to add two complex numbers.\n");
      printf("Press 2 to multiply two complex numbers.\n");
      printf("Press 3 to exit.\n");
      printf("Enter your choice\n");
      scanf_s("%d", &amp;choice);
  
      if (choice == 3)
          exit(0);
  
      if (choice &gt;= 1 &amp;&amp; choice &lt;= 2)
      {
          printf("Enter a and b where a + ib is the first complex number.");
          printf("\na = ");
          scanf_s("%d", &amp;a.real);
          printf("b = ");
          scanf_s("%d", &amp;a.img);
          printf("Enter c and d where c + id is the second complex number.");
          printf("\nc = ");
          scanf_s("%d", &amp;b.real);
          printf("d = ");
          scanf_s("%d", &amp;b.img);
      }
      if (choice == 1)
      {
          c.real = a.real + b.real;
          c.img = a.img + b.img;
  
          if (c.img &gt;= 0)
          printf("Sum of two complex numbers = %d + %di", c.real, c.img);
          else
          printf("Sum of two complex numbers = %d %di", c.real, c.img);
      }
  
      else if (choice == 2)
      {
          c.real = a.real*b.real - a.img*b.img;
          c.img = a.img*b.real + a.real*b.img;
  
      if (c.img &gt;= 0)
      printf("Multiplication of two complex numbers = %d + %di", c.real, c.img);
          else
      printf("Multiplication of two complex numbers = %d %di", c.real, c.img);
      }
  
  
      else
      printf("Invalid choice.");
  
      printf("\nPress any key to enter choice again...\n");
  }
      }
  </code></pre>