C/C++: Afficher les caractères imprimables à l’aide de ‘isgraph()’ et ‘printf’

Author:


{filelink=13110}

#include 
#include 

void main() {

  char ch = 0;

  for(int i = 0 ; i<128 ; i++)
  {
    ch = (char)i;
    if( ch % 2 == 0)
      printf("");
	//Affichage des caractères et leurs codes ASCII
    printf("  %4d    %cn",ch,(isgraph(ch) ? ch : ' '));
  }
  printf("");
}

Leave a Reply

Your email address will not be published. Required fields are marked *