Advertisement
midnight_sun

Untitled

Mar 26th, 2025
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. int main() {
  3.     //char age -> 세미콜론 미작성
  4.     char age;
  5.  
  6.     //scanf("&c", age); -> &c가 아닌 %c, scanf를 해줄때는 변수 앞에 &를 붙여주어야 하기에 age가 아닌 &age
  7.     scanf("%c", &age);
  8.  
  9.     //printf("&d", age); -> &d가 아닌 %d
  10.     printf("%d", age);
  11.  
  12.     /*
  13.     서식문자에 대한 공부 필요성이 느껴짐
  14.  
  15.     문자를 입력 받고 숫자를 출력하려고 노력한 점은 좋았음
  16.     */
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement