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
Are pointers integer?
When should we use pointers in a c program?
plz let me know how to become a telecom protocol tester. thank you.
Can a variable be both constant and volatile?
Can we compile a program without main() function?
about c language
What is string function c?
If errno contains a nonzero number, is there an error?
What are the complete rules for header file searching?
What is the difference between if else and switchstatement
How can I insert or delete a line (or record) in the middle of a file?
please send me the code for multiplying sparse matrix using c
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
In a switch statement, explain what will happen if a break statement is omitted?
what is the format specifier for printing a pointer value?