C Programming Tutorial – 66: The getchar() and putchar() Functions

In this tutorial we’ll see how we can use the getchar() function to receive single character input and how we can display characters using the putchar() function.


Rajnikanth Rajni says:

thank you dude.

Patrick Roosenburg says:

putchar handzup

Blaze Kazama says:

Thanks! In the first second of your video, I understood how they are used by how you arranged the program. I cannot express how terribly they explained it at my college.. 

Gudu Kasa says:

 char ch;
 printf(“Enter a character:”);
 ch = getchar();
 printf(“The character entered is:”);


Here is the code

takeshi gomez says:

Thanks a lot!!

Oleksandr Mapatelian says:

Hey! What service do you use to write the code and display the output? Thanks!

Supreet M says:

Is this the syntax for putchar() and get char()

Limon Sheikh says:

really very bad

Anna Georgieva says:

Your tutorials are amazing, I understand everything because of you, bless u,

Yarden Modan says:


Michael Knox says:

As always, spot on!

Prakash Subedi says:


Bill Stanard says:

Very nice! Thank you. What IDE are you using? I am having a problem running this short example in Eclipse on a Windows 7 machine.


Cesare Venzo says:

your english is very bad

pedro nobrega says:

hello man can you help me ?
i know gow to PRINT ancii chars on screen..
what i need to know its how to execute those commands ..
(example: i want to extract ancii chars + concaternate then + execute then)

char a = 21;
char b = 32;
char command = putchar(a);putchar(b);
int system(char command);


h Kamboj says:

if i use a loop….
for(int i =0; (ch= getchar()) !=EOF;i++)
ch = getchar();
then when will the loop terminate

Wahid Hamidy says:

Thanks buddy, it helps a lot

Joel Jones says:

Where is include

Aleksandar Ivanov says:

Why would i use getchar and putchar ? Like i understand what they are doing but why would i use them and i have printf scanf etc.

jack smack says:

I been trying to use visual studio to run this code but sadly it doesn’t work. What program are you using?

Fahad Anwar says:

We can do the same using scanf() and printf(). So is there a difference between their usage based on your example?

Advik Singh says:

is there a way by which we can take input without pressing ENTER Key
i.e., Are you sure to quit? y/n where pressing y close application and pressing n go to another statement in the program.
If anybody knows it please reply to my comment.

11swallowedinthesea says:


Write a comment


Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles   Show Cars   Motorbikes   Scooters   Rims & Tires   Luxury BoatsFashion   Sunglasses   Luxury Watches   Luxury Purses   Jeans Wear   High Heels   Perfumes   Jewellery   Cosmetics   Shaving Helpers   Fashion HatsFooding   Chef Club   Fooding Helpers   Coktails & LiquorsSports   Sport Shoes   Fitness & Detox   Golf Gear   Racquets   Diving Equipment   Ski Gear   Snowboards   Surf Boards   Rollers & SkatesEntertainment   DIY Guides   Zik Instruments   Published Books   Music Albums   Cine Movies   Trading Helpers   Make Money   Fishing Equipment   Paintball Supplies   Trading Card Games   Telescopes   Knives   VapesHigh Tech   Flat Screens   Tech Devices   Camera Lenses   Printers   USB Devices   PC Hardware   Network Gear   Cloud Servers   Software Helpers   Programmer Helpers   Mobile Apps   Hearing AidsHome   Home Furniture   Home Appliances   Beddings   Floor Layings   Barbecues   Aquarium Gear   Safe Boxes   Office Supplies   Security Locks   Cleaning ProductsKids   Baby Strollers   Child Car Seats   Remote ControlledTravel   Luggages & Bags   Airlines Seats   Hotel Rooms   Fun Trips   Cruise Ships   Mexico Tours