C program to print characters without using format specifiers


In this article we will see how we can print some characters without using any kind of format specifiers. The format specifiers in C are %d, %f, %c etc.These are used to print characters and numbers in C using the printf() function.

Here we will see another way to print characters without using %c format specifier. This can be done by putting ASCII values directly in hexadecimal form.

Example Code

#include <stdio.h>
main () {
   printf("\x41 
"); //41 is ASCII of A in Hex printf("\x52
"); //41 is ASCII of A in Hex printf("\x69
"); //41 is ASCII of A in Hex }

Output

A
R
i

Updated on: 30-Jul-2019

560 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements