title: Is any semantically correct and syntactically correct C program an algorithm?
body: <p>" An algorithm is defined to be a finite sequence of operations which whn executed will accomplish a specific task" with this definition. Can we say that ANY syntactically and semantically correct C program is also an algorithm?</p>
  
  <p>my answer is TRUE, however my professor said the answer is FALSE, so did my blockmate.
  The counter example they used was</p>
  
  <pre><code>while(1) {
  
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>printf("%s","blahblah");
  </code></pre>
  
  <p>the infinite loop isn't semantically correct, while the printf() accomplishes a task so it is an algorithm. Because you can use a loop and putchar() instead of printf();</p>
  
  <p>So who do you guys think is right?</p>