fork download
  1. #include <stdio.h>
  2. void calculate(int *,int *);
  3. void main()
  4. {
  5. int a,b,*p,*q;
  6. p=&a;
  7. q=&b;
  8. printf("Enter Hight:");
  9. scanf("%d",&a);
  10. printf("Enter Width:");
  11. scanf("%d",&b);
  12. calculate(*a,*b);
  13. }
  14. void calculate(int *a,int *b)
  15. {
  16. int ans;
  17. ans = (1/2)*(*a)*(*b);
  18. printf("Ans = %d",ans);
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
 void main()
      ^~~~
prog.c: In function ‘main’:
prog.c:12:15: error: invalid type argument of unary ‘*’ (have ‘int’)
     calculate(*a,*b);
               ^~
prog.c:12:18: error: invalid type argument of unary ‘*’ (have ‘int’)
     calculate(*a,*b);
                  ^~
prog.c:5:17: warning: variable ‘q’ set but not used [-Wunused-but-set-variable]
     int a,b,*p,*q;
                 ^
prog.c:5:14: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
     int a,b,*p,*q;
              ^
stdout
Standard output is empty