fork download
  1. #/// C code
  2. // This program will calculate the Perimeter of a triangle.
  3. // Developer: Nickie Foxworth CMIS102
  4. // Date: March 26, 2017
  5.  
  6. #include <stdio.h>
  7.  
  8. int main ()
  9. {
  10. /* variable definition: */
  11. float side1, side2, side3,TriPerm;
  12.  
  13. /*initialize variables */
  14. side1=4.0;
  15. side2=6.0;
  16. side3=8.0;
  17.  
  18. /* Prompt user for side1 */
  19. printf("Enter side1 of the triangle: \n");
  20.  
  21. // Input side1
  22. scanf("%f", &side1);
  23.  
  24. /*prompt user for side2 */
  25. printf(“Enter side2 of the triangle: \n”);
  26.  
  27. //Input side2
  28. scanf(%f”, &side2);
  29.  
  30. /*prompt user for side3 */
  31. printf(“Enter side3 of the triangle: \n”);
  32.  
  33. //Input side3
  34. scanf(%f”, &side3);
  35.  
  36. // Calculate the Perimeter
  37. TriPerm= side1+side2+side3;
  38.  
  39. // Print the result
  40. printf(“Perimeter is : %f\n", TriPerm);
  41.  
  42. return 0;
  43. }
  44.  
  45.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:25:10: error: stray ‘\342’ in program
   printf(“Enter side2 of the triangle: \n”);
          ^
prog.c:25:11: error: stray ‘\200’ in program
   printf(“Enter side2 of the triangle: \n”);
           ^
prog.c:25:12: error: stray ‘\234’ in program
   printf(“Enter side2 of the triangle: \n”);
            ^
prog.c:25:13: error: ‘Enter’ undeclared (first use in this function)
   printf(“Enter side2 of the triangle: \n”);
             ^~~~~
prog.c:25:13: note: each undeclared identifier is reported only once for each function it appears in
prog.c:25:19: error: expected ‘)’ before ‘side2’
   printf(“Enter side2 of the triangle: \n”);
                   ^~~~~
prog.c:25:42: error: stray ‘\’ in program
   printf(“Enter side2 of the triangle: \n”);
                                          ^
prog.c:25:44: error: stray ‘\342’ in program
   printf(“Enter side2 of the triangle: \n”);
                                            ^
prog.c:25:45: error: stray ‘\200’ in program
   printf(“Enter side2 of the triangle: \n”);
                                             ^
prog.c:25:46: error: stray ‘\235’ in program
   printf(“Enter side2 of the triangle: \n”);
                                              ^
prog.c:28:9: error: stray ‘\342’ in program
   scanf(“%f”, &side2);
         ^
prog.c:28:10: error: stray ‘\200’ in program
   scanf(“%f”, &side2);
          ^
prog.c:28:11: error: stray ‘\234’ in program
   scanf(“%f”, &side2);
           ^
prog.c:28:12: error: expected expression before ‘%’ token
   scanf(“%f”, &side2);
            ^
prog.c:28:14: error: stray ‘\342’ in program
   scanf(“%f”, &side2);
              ^
prog.c:28:15: error: stray ‘\200’ in program
   scanf(“%f”, &side2);
               ^
prog.c:28:16: error: stray ‘\235’ in program
   scanf(“%f”, &side2);
                ^
prog.c:31:10: error: stray ‘\342’ in program
   printf(“Enter side3 of the triangle: \n”);
          ^
prog.c:31:11: error: stray ‘\200’ in program
   printf(“Enter side3 of the triangle: \n”);
           ^
prog.c:31:12: error: stray ‘\234’ in program
   printf(“Enter side3 of the triangle: \n”);
            ^
prog.c:31:19: error: expected ‘)’ before ‘side3’
   printf(“Enter side3 of the triangle: \n”);
                   ^~~~~
prog.c:31:42: error: stray ‘\’ in program
   printf(“Enter side3 of the triangle: \n”);
                                          ^
prog.c:31:44: error: stray ‘\342’ in program
   printf(“Enter side3 of the triangle: \n”);
                                            ^
prog.c:31:45: error: stray ‘\200’ in program
   printf(“Enter side3 of the triangle: \n”);
                                             ^
prog.c:31:46: error: stray ‘\235’ in program
   printf(“Enter side3 of the triangle: \n”);
                                              ^
prog.c:34:9: error: stray ‘\342’ in program
   scanf(“%f”, &side3);
         ^
prog.c:34:10: error: stray ‘\200’ in program
   scanf(“%f”, &side3);
          ^
prog.c:34:11: error: stray ‘\234’ in program
   scanf(“%f”, &side3);
           ^
prog.c:34:12: error: expected expression before ‘%’ token
   scanf(“%f”, &side3);
            ^
prog.c:34:14: error: stray ‘\342’ in program
   scanf(“%f”, &side3);
              ^
prog.c:34:15: error: stray ‘\200’ in program
   scanf(“%f”, &side3);
               ^
prog.c:34:16: error: stray ‘\235’ in program
   scanf(“%f”, &side3);
                ^
prog.c:40:10: error: stray ‘\342’ in program
   printf(“Perimeter is : %f\n", TriPerm);
          ^
prog.c:40:11: error: stray ‘\200’ in program
   printf(“Perimeter is : %f\n", TriPerm);
           ^
prog.c:40:12: error: stray ‘\234’ in program
   printf(“Perimeter is : %f\n", TriPerm);
            ^
prog.c:40:13: error: ‘Perimeter’ undeclared (first use in this function)
   printf(“Perimeter is : %f\n", TriPerm);
             ^~~~~~~~~
prog.c:40:23: error: expected ‘)’ before ‘is’
   printf(“Perimeter is : %f\n", TriPerm);
                       ^~
prog.c:40:30: error: stray ‘\’ in program
   printf(“Perimeter is : %f\n", TriPerm);
                              ^
prog.c:40:32: warning: missing terminating " character
   printf(“Perimeter is : %f\n", TriPerm);
                                ^
prog.c:40:32: error: missing terminating " character
   printf(“Perimeter is : %f\n", TriPerm);
                                ^~~~~~~~~~~~
prog.c:43:1: error: expected ‘;’ before ‘}’ token
 }
 ^
prog.c:11:29: warning: variable ‘TriPerm’ set but not used [-Wunused-but-set-variable]
   float side1, side2, side3,TriPerm;
                             ^~~~~~~
stdout
Standard output is empty