sivaguhan


{ City } coimbatore
< Country > india
* Profession * student
User No # 15025
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 28
Users Marked my Answers as Wrong # 8
Questions / { sivaguhan }
Questions Answers Category Views Company eMail




Answers / { sivaguhan }

Question { Wipro, 15260 }

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

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