Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

By using getchar() and EOF, creata a program in C (not C++) that will count the

ID: 3665052 • Letter: B

Question

By using getchar() and EOF, creata a program in C (not C++) that will count the user input(including uppercase, lowercase letters, digits, etc... The output of the program shoud print as the following: ----------------------------------------------------- - total count of digits: - total count of words:
- total count of characters:
- total count of uppercase letters:
- total count of lowercase letters: ------------------------------------------------------ By using getchar() and EOF, creata a program in C (not C++) that will count the user input(including uppercase, lowercase letters, digits, etc... The output of the program shoud print as the following: ----------------------------------------------------- - total count of digits: - total count of words:
- total count of characters:
- total count of uppercase letters:
- total count of lowercase letters: ------------------------------------------------------

Explanation / Answer

program for counting lower case and upper case letters

program for counting digits

program for words and characters

#include<stdio.h>
#include<conio.h>
void main()
{
int noc=0,now=0,nol=0;
FILE *fw,*fr;
char fname[20],ch;
clrscr();
printf(" enter the source file name");
gets(fname);
fr=fopen(fname,"r");

if(fr==NULL)
{
printf(" error ");
exit(0);
}
ch=fgetc(fr);
while(ch!=EOF)
{
noc++;

if(ch==' ');
now++;
if(ch==' ')
{
nol++;
now++;
}

ch=fgetc(fr);
}
fclose(fr);
printf(" total no of character=%d",noc);
printf(" total no of words=%d",now);
printf(" total no of lines=%d",nol);
getch();
}

#include <stdio.h>