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