fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. { int t,n,log,po;
  5. printf("\nTest Cases:");
  6. scanf("%d",&t);
  7. while(t--)
  8. { printf("\nNumber:");
  9. scanf("%d",&n);
  10. log=log10(n);
  11. printf("\nlog=%d\n",log);
  12. po=pow(10,log);
  13. printf("pow(10,log)=%d\n",po);
  14. po=pow(10,log-1);
  15. printf("pow(10,log-1)=%d\n",po);
  16. po=pow(10,log);
  17. printf("pow(10,log)=%d\n",po);
  18. po=pow(10,log)/10;
  19. printf("pow(10,log)/10=%d\n\n",po);
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 1680KB
stdin
2
1020
10230
stdout
Test Cases:
Number:
log=3
pow(10,log)=1000
pow(10,log-1)=100
pow(10,log)=1000
pow(10,log)/10=100


Number:
log=4
pow(10,log)=10000
pow(10,log-1)=1000
pow(10,log)=10000
pow(10,log)/10=1000