hello2.c 474 B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. #include <time.h>
  3. /*
  4. * hello.c
  5. */
  6. int main2(void) {
  7. printf("Hello World!\n");
  8. printf("long lenth = %d, int lenth = %d\n", sizeof(long), sizeof(int));
  9. int a;
  10. long b;
  11. printf("a = %d\n", a);
  12. printf("b = %d\n", b);
  13. double cpu_temp;
  14. unsigned int ticksnow; /* clock_t is same as int */
  15. ticksnow = (unsigned int)clock();
  16. cpu_temp = (double)((double)ticksnow/CLOCKS_PER_SEC);
  17. printf("cpu_temp = %lf\n", cpu_temp);
  18. return 0;
  19. }