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

what is the coding of display the factorial of a number using array and function?

1 Answers  


for (i <= 5 && i >= -1;++i; i > 0) { printf("%d ", i); }

1 Answers  


Explain what happens if you free a pointer twice?

0 Answers  


why we are using float in C

4 Answers  


write a program for fibonaci series by using while loop in c?

2 Answers  






How can I access a memory located at certain address?

2 Answers   CSC,


How can draw a box in cprogram without using graphics.h header file & using only one printf(); ?

4 Answers   NIIT,


program to locate string with in a string with using strstr function

2 Answers   Huawei, Shreyas,


Explain how do you determine whether to use a stream function or a low-level function?

0 Answers  


explain what is a newline escape sequence?

0 Answers  


how to find greatet of 10 numbers without using array?

4 Answers  


Is it possible to run using programming C for Java Application?

2 Answers   NIC,


Categories