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


Please Help Members By Posting Answers For Below Questions

Can include files be nested?

631


What is pragma in c?

633


explain what is an endless loop?

615


how to write a c program to print list of fruits in alpabetical order?

1797


What does 3 mean in texting?

620






What is break statement?

636


What is sizeof int?

641


What is call by value in c?

563


How can you convert integers to binary or hexadecimal?

622


What are the different types of control structures?

590


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?

1667


Explain what is a program flowchart and explain how does it help in writing a program?

653


What are all different types of pointers in c?

581


What does the file stdio.h contain?

608


All technical questions

1514