title: How do I run a program written in c on a computer which has no compiler
body: <p>This a program to calculate GPA. The program is running properly. How can I run this program on a computer which has no compiler installed.?
  How do I run this program on a pc which has no compiler?</p>
  
  <pre><code> #include &lt;stdio.h&gt;
   #include &lt;stdlib.h&gt;
   #include &lt;string.h&gt;
  
    int main() {
          char str[100], ch;
          int i, grade[8];
          float credit[8], gpa = 0.0, totCredit = 0.0;
  
          /* get the letter grade and credits from the user */
          printf("Letter Grade and Credits for each subject:\n");
          for (i = 0; i &lt; 8; i++) {
                  printf("Subject %d(Grade|Credit):", i + 1);
                  ch = getchar();
                  grade[i] = ch;
                  scanf("%f", &amp;credit[i]);
                  getchar();
          }
  
          /* print the input grades and credits */
          printf("\nSubject | Grade | Credit\n");
          for (i = 0; i &lt; 8; i++) {
                  printf("   %d    |  %c    | %.1f\n", i + 1, grade[i], credit[i]);
          }
  
          /* calculate gpa value */
          for (i = 0; i &lt; 8; i++) {
                  switch (grade[i]) {
                          case 'S':
                                  gpa = gpa + 10 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
                          case 'A':
                                  gpa = gpa + 9 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
  
                          case 'B':
                                  gpa = gpa + 8 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
  
                          case 'C':
                                  gpa = gpa + 7 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
  
                          case 'D':
                                  gpa = gpa + 6 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
  
                          case 'E':
                                  gpa = gpa + 5 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
  
                          case 'F':
                                  gpa = gpa + 4 * credit[i];
                                  totCredit = totCredit + credit[i];
                                  break;
  
                          default:
                                  printf("Given Wrong grade!!\n");
                                  exit(0);
  
                  }
          }
          printf("GPA: %.1f\tcredit: %.1f\n", gpa, totCredit);
          gpa = gpa / totCredit;
          printf("GPA for your score: %.2f\n", gpa);
          return 0;
    }
  </code></pre>
  
  <p>This a program to calculate GPA. The program is running properly. How can I run this program on a computer which has no compiler installed.?
  How do I run this program on a pc which has no compiler?</p>