Implement the isgraph() : C
Hello, I am the student of the Bsc-IT. I had learned the C language in first year of Bsc-IT. I can know about the functions in C language. I have to submit the assignment on the isgraph() function. So, I would like to know about the isgraph() function. I would also like to know how can I Implement the isgraph() function in C language. If there is anyone who can have the solution on the isgraph() functions then reply me!!!
Implement the isgraph() : C
Hi, The isgraph() function can checks except space for any printable character. The isgraph() function can be the member of the <ctype.h> header file. The isgraph() function can returns the zero if the argument of the isgraph() function can not be a printable character code. And returns the space or zero if the argument of the isgraph() function can be a printable character code. The following can be the syntax of the isgraph() function in the C language :
Code:
#include <ctype.h>
int isgraph( int d );
Program : Implement the isgraph()
Program :
Code:
#include <ctype.h>
#include <stdio.h>
int main(void)
{
char C;
for(;;) {
C = getchar();
if(isgraph(C)){
printf("%c is printable\n", C);
}
if(C == '.'){
break;
}
}
return 0;
}
Output :
Code:
1
1 is printable
2
2 is printable
3
3 is printable
4
4 is printable
.
. is printable