c pgm count no of lines , blanks, tabs in a para(File concept)

Answer Posted / shanker khandelwal (bce mohali

include <stdio.h>

void main()
{
FILE *FP;
char Ch;
int l=o,b=0,t=0,p=0;
FP = fopen(filename, mode);
while (FP) {
if(ch==EOF)
break;
l++;
if(ch==" ")
b++;
if(ch=="\n")
p++;
if(ch=="\t")
t++;
fclose(fp);
display counts;
getch();
}

Is This Answer Correct ?    16 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to delete a node from linked list w/o using collectons?

2090


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

655


What are the primitive data types in c?

579


How do we open a binary file in Read/Write mode in C?

681


What is hungarian notation? Is it worthwhile?

700






Write a program to generate random numbers in c?

664


What does %p mean c?

633


What is the difference between int main and void main in c?

594


What is the acronym for ansi?

632


What is the significance of scope resolution operator?

864


Is it possible to execute code even after the program exits the main() function?

819


What does *p++ do?

588


What is a class c rental property?

617


What are the 5 data types?

603


What are the different categories of functions in c?

648