fork download
  1. /// C code
  2. // This program will calculate the perimeter of a right triangle.
  3. // Developer: Faculty CMIS102
  4. // Date: Jun 22, 2018
  5. #include <stdio.h>
  6.  
  7. int main ()
  8. {
  9. /* variable definition: */
  10. float base, length1, length2;
  11. /* Prompt user for base */
  12. printf("Enter the base of the triangle: 10 \n");
  13. // Input the base
  14. scanf("%f", &base);
  15. /* Prompt user for length1 of a triangle */
  16. printf("Enter the length of one side of the triangle: 13 \n");
  17. // Input the length1
  18. scanf("%f", &length1);
  19. /* Prompt user for length2 of a triangle */
  20. printf("Enter the length of one side of the triangle: 9 \n");
  21. // Input the length2
  22. scanf("%f", &length2);
  23. // Calculate the Perimeter
  24. perimeter= 10 + 13 + 9;
  25. // Print the result
  26. printf("Perimeter is : %f\n", Perimeter);
  27. return 0;
  28. }
  29.  
Compilation error #stdin compilation error #stdout 0s 4464KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:24:3: error: ‘perimeter’ undeclared (first use in this function)
   perimeter= 10 + 13 + 9;
   ^~~~~~~~~
prog.c:24:3: note: each undeclared identifier is reported only once for each function it appears in
prog.c:26:33: error: ‘Perimeter’ undeclared (first use in this function)
   printf("Perimeter is : %f\n", Perimeter);
                                 ^~~~~~~~~
stdout
Standard output is empty