solving/C, C++

[CodeUp] C기초100제 - 1004 : [기초-출력] 출력하기04

Seohyeong Lee 2022. 7. 6. 18:50

이번에는 작은 따옴표(single quotation mark)가 들어있는
특수한 형태의 출력문에 대한 연습을 해보자.

다음 문장을 출력하시오.

'Hello'

#include <stdio.h>

int main () {
    printf("\'Hello\'");
    return 0;
}

다음도 작동하는 것을 확인하였다. 

#include <stdio.h>

int main () {
    printf("'Hello'");
    return 0;
}

(참고) 작은따옴표를 출력하기 위해서는 \'로 입력해야 한다. 

큰따옴표도 마찬가지.