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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / saagar gugwad

#include <stdio.h>

int main()
{
FILE *FP;
char Ch;
FP = fopen(filename, mode);
while (FP) {
Ch=getch(FP);
switch(Ch) {
case ' '://incremnt space
break;
case ''://check all consitions
}
display counts;
}
}

Is This Answer Correct ?    3 Yes 12 No

Post New Answer

More C Interview Questions

c program for searching a student details among 10 student details

0 Answers  


implement general tree using link list

1 Answers   Wipro,


Can we increase size of array in c?

0 Answers  


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

0 Answers  


What is pass by reference in c?

0 Answers  






What are different types of variables in c?

0 Answers  


related to rdbms query .

2 Answers  


Explain what are multibyte characters?

0 Answers  


what is the difference b/w compiler and debugger?

2 Answers   Assurgent,


Is c language still used?

0 Answers  


Is it better to use malloc() or calloc()?

0 Answers   Aspire, Infogain,


If an old women's age is the same as her three grand daughters i,mean the number of days old child=the no of weeks old child=no of months old child .The total yrs of all these ppl is 114 yrs...then how old is the old woman? the yr has 365 days..and 30 days each month.

1 Answers   TCS,


Categories