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
What is meant by inheritance?
What is structure packing in c?
explain what are pointers?
Explain heap and queue.
Can a variable be both const and volatile?
while initialization of array why we use a[][2] why not a[2][]...?
How can I discover how many arguments a function was actually called with?
How can I manipulate individual bits?
What are pragmas and what are they good for?
Is calloc better than malloc?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
How can a string be converted to a number?
Explain what is the stack?
Explain modulus operator.
Why main is not a keyword in c?