fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. void integerPower(int y, int *base1, int *base2, int *base3, int *total) {
  5. *base1 = pow(y, 2);
  6. *base2 = pow(y, 3);
  7. *base3 = pow(y, 4);
  8. *total = *base1 + *base2 + *base3;
  9. }
  10. int main(void) {
  11. int base1, base2, base3, total;
  12. integerPower(5, &base1, &base2, &base3, &total);
  13. printf("%d\n", base1);
  14. printf("%d\n", base2);
  15. printf("%d\n", base3);
  16. printf("%d\n", total);
  17. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
25
125
625
775