×

C Programs

C Basic & Conditional Programs

C Looping Programs

C String Programs

C Miscellaneous Programs

C program to print character without using format specifiers

As we know that, printf prints the character or any other type of value by passing format specifiers like %d, %c, %f, %ld, ... to print their corresponding value. But here is method by using this we can print the character value of any ascii code. In this program we will print character values without using format specifier %c.

Print characters without using format specifier - %c

/*
 C program to print character without 
 using format specifiers
*/

#include <stdio.h>

int main()
{
    printf("\x41");
    printf("\n");

    printf("\x42");
    printf("\n");

    printf("\x43");
    printf("\n");

    printf("\x44");
    printf("\n");

    return 0;
}

Output

    A
    B
    C
    D

In this program, we are printing the value of 0x41, 0x42, 0x43, 0x44 these are the ASCII Codes of A, B, C, D respectively.

C Advance Programs »

Related Programs

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.