pgm to find number of words starting with capital letters
in a file(additional memory usage not allowed)(if a word
starting with capital also next letter in word is capital
cann't be counted twice)
Answer Posted / shiva
int flag=0,count=0;
FILE *in=fopen("in.txt","r");
while(!feof(in))
{
if( isupper( fgetc(in) ) && flag==0)
{
flag=1;
count++;
}
else if( fgetc(in) ==' ')
flag=0;
}
printf("Count=%d",count);
// PROGRAM VERIFIED WITH SAMPLE INPUT
| Is This Answer Correct ? | 28 Yes | 8 No |
Post New Answer View All Answers
Explain what is the best way to comment out a section of code that contains comments?
What is realloc in c?
Explain the advantages and disadvantages of macros.
Subtract Two Number Without Using Subtraction Operator
What is the benefit of using const for declaring constants?
What is d scanf?
What is line in c preprocessor?
What is the size of empty structure in c?
Explain main function in c?
What does int main () mean?
How do you define a string?
What is printf () in c?
how is the examination pattern?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
Is there a way to compare two structure variables?