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 the usage of the pointer in c?
What are the modifiers available in c programming language?
What are high level languages like C and FORTRAN also known as?
Can you add pointers together? Why would you?
Why do we use null pointer?
What are reserved words?
Are local variables initialized to zero by default in c?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
What does sizeof return c?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
write a program fibonacci series and palindrome program in c
Is c easy to learn?
What is the role of this pointer?
What is ambagious result in C? explain with an example.
Why can arithmetic operations not be performed on void pointers?