Write A Program To Count Uppercase And Lowercase Letters In File

 


Input Text File

Increase Input Text File

Code


%{

#include<stdio.h>
int U=0;
int L=0;
%}

%%
[A-Z] U++;
[a-z] L++;

%%

main()
{
extern FILE *yyin;
yyin=fopen("UpperLowerInput.txt","r");
if(yyin==NULL){
printf("File Not Found");
}
yylex();

printf("\nTotal No of UpperCase Character=%d",U);
printf("\nTotal No of LowerCase Character=%d",L);
}
int yywrap()
{
return 1;
}


Output






Comments

Popular posts from this blog

Write A Program To Print Hello World Using Lex

Create a Student registration form using following tags form,input,textarea,button,select,optio. The registration form must consist of following information: first name,Middle name,last name, gender(use radio button),address,phone no,email id,hobbies(use checkbox),city,state,country,collage name (use dropdown menu).