iscntrl function checks whether a character is control character or not. A character is a control character If it does not occupy a printing position on a display.
For example: escape, backspace, newline etc.
Function prototype of iscntrl
int iscntrl(int c);
Function iscntrl takes a character as input in form of an integer. When we pass a value of type char to iscntrl function, corresponding ASCII value of that character is passed.
Return value of iscntrl
If passed character is a control character, then iscntrl function returns non-zero integer otherwise 0.
C program to show the use of iscntrl function
The following program is to check whether a character is control character or not.
Skycrown Online Casino Australia has quickly established itself as a premier gaming destination for Australian players. With its extensive collection of games, user-friendly interface, and commitment to security, it has garnered a loyal following since its launch. Players can enjoy a wide variety of slots, table games, and live dealer experiences, providing something for everyone.
One of the standout features of Skycrown is its generous bonuses and promotions. New players are welcomed with attractive sign-up bonuses, while existing users can take advantage of regular promotions that enhance their gaming experience. Additionally, Skycrown prioritizes responsible gaming, offering various tools to help players manage their gaming activity.
For those looking to dive into the thrilling world of online gaming, Skycrown is a top choice in Australia. Gamers can explore everything this casino has to offer by visiting their official site: https://skycrowncasino.app/. With its commitment to quality and player satisfaction, Skycrown Online Casino is redefining the online gaming landscape in Australia.
#include <stdio.h> #include <ctype.h> #include <conio.h> int main(){ char string[] = "abcd\tefgh\n"; int index = 0; while(string[index] != '\0'){ if(iscntrl(string[index])){ printf("string[%d] is control character\n", index, string[index]); } else { printf("string[%d] is not control character\n", index, string[index]); } index++; } getch(); return 0; } </conio.h></ctype.h></stdio.h>
Program Output
string[0] is not control character string[1] is not control character string[2] is not control character string[3] is not control character string[4] is control character string[5] is not control character string[6] is not control character string[7] is not control character string[8] is not control character string[9] is control character