Quick actions

cmd+k|ctrl+k

Navigation

Languages

numliterals

Snippet info

Language

C

Visibility

public

Author

charli2624

Created

2020-12-26T07:39:24Z

Updated

2020-12-26T07:40:57Z

#include <stdio.h>

int main(void) {
   puts ("정수");
   printf("%d ",30); printf("%d ",10);
   printf("%d ",030); printf("%d ",010);
   printf("%d ",0x2f); printf("%d\n",0x1b);
   // %d하고 스페이스바를 눌러야 띄어쓰기가 된다.
   // 안 그러면 다 붙어서 나온다.
   
   puts ("실수");
   printf("%f ",30); printf("%f ",10);
   printf("%.2f ",30); printf("%.2f ",10);
   // 소수점 안붙으면 f써봐야 0.000만 나온다.
   
   printf("%f ",3.14); printf("%f ",2.0);
   printf("%f ",3.14E+2); printf("%f ",21.8e2);
   printf("%.2f ",3.14E+2); printf("%.2f ",21.8e2);
   printf("%f ",3.14E-2); printf("%f\n ",218e-3);
  
   
   return 0;
}
INFO