#include<stdio.h>
main( )
{
  FILE *fp;
  char ch;
  int countNewline=0, counttotal=0, counttabs=0, countspaces=0;
  fp = fopen("my.txt", "r");
  if(fp == NULL)
  {
     printf("Unable to open the file \n");
     system("pause");
     exit(0);
  }
  while(1)
  {
     ch = fgetc(fp); 
     if(ch == EOF)
        break;
     counttotal++;   
     if(ch =='\n')
        countNewline++;        
     else if(ch == '\t')
        counttabs++;  
     else if(ch == ' ')
        countspaces++;
  }
  printf("total character = %d\n",counttotal );
  printf("New line = %d, tabs = %d, spaces = %d\n",countNewline, counttabs, countspaces);            
  system("pause");
}      
