fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4.  
  5. int main()
  6. {
  7. double v, a;
  8. printf("enter speed: \n");
  9. scanf("%lf", &v);
  10. printf("enter angle: \n");
  11. scanf("%lf", &a);
  12.  
  13. printf("height is: %f \n", hfunc(v,a));
  14. printf("length is: %f \n", dfunc(v,a));
  15.  
  16. return 0;
  17. }
  18.  
  19. double hfunc(double v, double a) {
  20. return ((pow(v,2))-pow(sin(a), 2))/(2*9.81);
  21. }
  22.  
  23. double dfunc(double v, double a) {
  24. return ((pow(v,2)-(sin(2*a)))/9.81);
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:13:33: warning: implicit declaration of function ‘hfunc’ [-Wimplicit-function-declaration]
     printf("height is: %f  \n", hfunc(v,a));
                                 ^~~~~
prog.c:13:25: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘int’ [-Wformat=]
     printf("height is: %f  \n", hfunc(v,a));
                         ^
prog.c:14:32: warning: implicit declaration of function ‘dfunc’ [-Wimplicit-function-declaration]
     printf("length is: %f \n", dfunc(v,a));
                                ^~~~~
prog.c:14:25: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘int’ [-Wformat=]
     printf("length is: %f \n", dfunc(v,a));
                         ^
prog.c: At top level:
prog.c:19:8: error: conflicting types for ‘hfunc’
 double hfunc(double v, double a) {
        ^~~~~
prog.c:13:33: note: previous implicit declaration of ‘hfunc’ was here
     printf("height is: %f  \n", hfunc(v,a));
                                 ^~~~~
prog.c:23:8: error: conflicting types for ‘dfunc’
 double dfunc(double v, double a) {
        ^~~~~
prog.c:14:32: note: previous implicit declaration of ‘dfunc’ was here
     printf("length is: %f \n", dfunc(v,a));
                                ^~~~~
stdout
Standard output is empty