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

What are integer variable, floating-point variable and character variable?

598


c program for searching a student details among 10 student details

1646


What is the best way of making my program efficient?

561


Can a variable be both static and volatile in c?

602


given post order,in order construct the corresponding binary tree

2312






difference between Low, Middle, High Level languages in c ?

1626


What is quick sort in c?

577


Is c is a procedural language?

589


What does %c do in c?

578


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

708


What is an array in c?

589


How does selection sort work in c?

613


How does #define work?

642


Write a program to print “hello world” without using semicolon?

667


What are disadvantages of C language.

640