Saturday, March 6, 2021

, , , ,

Example program for isprint() in c

 The isprint() function in c programming is used to check the given character is a printable character or not.

Printable characters in c programming are just the opposite of control characters and these type of characters checked using iscntrl() function in c.

Syntax for isprint() in c

int isprint( int arg );

for return value if the given characters passed to isprint() function in c is a printable character then it return non-zero integer otherwise return zero.

isprint() in c takes argument in the form of integer and returns.

Example for C isprint() function

 

#include <ctype.h>
#include <stdio.h>

int main()
{
    char c;

    c = 'Q';
    printf("Result when a printable character %c is passed to isprint(): %d", c, isprint(c));

    c = '\n';
    printf("\nResult when a control character %c is passed to isprint(): %d", c, isprint(c));

    return 0;
}

 OUTPUT : - 

C isprint()
C isprint() function in c

 

0 comments:

Post a Comment