fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n,square,cube;
  5. scanf("%d",&n);
  6. square = n*n;
  7. cube = n*n*n;
  8.  
  9. printf("the square of %d is: %d\n",n,square);
  10. printf("the cube of %d is: %d\n",n,cube);
  11.  
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5320KB
stdin
5
stdout
the square of 5 is: 25
the cube of 5 is: 125