Multiple choice

What does the following program code do? #include<stdio.h> void main() {FILE *f;char ch; int noi=0; f=open(“d.txt”,”r”); while(1) { ch=fgetc(f); if(f==EOF) break; if(ch==’ ‘) noi++’;} fclose(f); printf(“No. of …….=%d”,noi);}

  1. Counts total number of character in file d.txt

  2. Counts number of blanks in file d.txt

  3. Counts number of tabs in file d.txt

  4. Counts number of lines in file d.txt

  5. Counts total number of characters in file ‘C’ source file

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The ‘ ‘ counts the blanks in file opened.