Click to See Complete Forum and Search --> : count the number of upercase letter in a text file


Caspersky12
April 1st, 2008, 01:52 AM
My teacher ask me to recode the program that will count the number of upercase letter in a text file...its so confusing.. HELP ME PLEASE...
I wish someone know this...


#include<stdio.h>
void main(void)
{
FILE *inputf;
char filename[40];
nt c;
printf("Input name of the text file");
scanf("%s",filename);
if (inputf = fopen(filename, "r") == NULL)
{
printf("ERROR: %s cannot be opened.\n", filename);
exit(1);
}
while ((c = fgetc(inputf)) != EOF) fputc(c, stdout);
fclose(inputf);
}