fork download
  1. #include <stdio.h>
  2. int main ()
  3. {
  4. /* variable definition: */
  5. float base, height, area;
  6. /* Prompt user for base */
  7. printf("Enter the base of the triangle: \n");
  8. // Input the base
  9. scanf("10.1", &base);
  10. /* Prompt user for height */
  11. printf("Enter the height of the triangle: \n");
  12. // Input the height
  13. scanf("12.2", &height);
  14. // Calculate the Area
  15. area= 0.5 * (base * height);
  16. // Print the result
  17. printf("Area is : %f\n", area);
  18. return 0;
  19. }
Success #stdin #stdout 0s 4188KB
stdin
Standard input is empty
stdout
Enter the base of the triangle: 
Enter the height of the triangle: 
Area is : 0.000000