Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Are pointers integer?

1074


When should we use pointers in a c program?

1196


plz let me know how to become a telecom protocol tester. thank you.

2239


Can a variable be both constant and volatile?

1183


Can we compile a program without main() function?

1181


about c language

2074


What is string function c?

1076


If errno contains a nonzero number, is there an error?

1432


What are the complete rules for header file searching?

1132


What is the difference between if else and switchstatement

2003


How can I insert or delete a line (or record) in the middle of a file?

1069


please send me the code for multiplying sparse matrix using c

2224


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2173


In a switch statement, explain what will happen if a break statement is omitted?

1125


what is the format specifier for printing a pointer value?

1074