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
Can include files be nested?
What is pragma in c?
explain what is an endless loop?
how to write a c program to print list of fruits in alpabetical order?
What does 3 mean in texting?
What is break statement?
What is sizeof int?
What is call by value in c?
How can you convert integers to binary or hexadecimal?
What are the different types of control structures?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
Explain what is a program flowchart and explain how does it help in writing a program?
What are all different types of pointers in c?
What does the file stdio.h contain?
All technical questions