CHANGE CASE - LEX - PROGRAM
Program:
// Lex file: cap.l
lower [a-z]
CAPS [A-Z]
space [ \t\n]
%%
{lower} {printf("%c",yytext[0]- 32);}
{CAPS} {printf("%c",yytext[0]+ 32);}
{space} ECHO;
. ECHO;
%%
main()
{
yylex();
}
Output:
nn@linuxmint ~ $ lex cap.l
nn@linuxmint ~ $ gcc lex.yy.c -ll
nn@linuxmint ~ $ ./a.out<tst.txt
WWW.2K8618.BLOGSPOT.COM
sanjana jamsheena chaithanya neethu
GOVINDAPRASAD VIPIN ADARSH SHIVIN
baby brinda kavya helen
SALMAN TINU RICHARD SIBIN
SHIVIN laji NABEEL
www.2k8cse.cu.cc
nn@linuxmint ~ $
// tst.txt
www.2k8618.blogspot.com
SANJANA JAMSHEENA CHAITHANYA NEETHU
govindaprasad vipin adarsh shivin
BABY BRINDA KAVYA HELEN
salman tinu richard sibin
shivin LAJI nabeel
WWW.2K8CSE.CU.CC
wrong answer
ReplyDeletelai bhari.......................................;-)
ReplyDeleteright answer ahe ga porano..
ReplyDeletekala ka???
ReplyDeletekya lai bhari... x-(
ReplyDeletede ga bai pen de
ReplyDeletenahi smjl
ReplyDeletehamara HOD kaisa ho??????
ReplyDeleteghe g bai black pen ghe
ReplyDeleteCD jaisa ho
ReplyDeletedurgaaaaaaaaaa idhar aooooooo
ReplyDeletedown arrow press karo ree
ReplyDeletekare na reeee........
ReplyDeletereply sirf dikhane k liye hi h ya work bhi karta..
ReplyDeletehow can I change the case of the first letter of my word?
ReplyDeleteonly the first letter not whole string
ReplyDeletewhy cant we give input dierectly ?
ReplyDeletewhy do we have to supply an extra file from outside for type converstion.
i need that type of programme
f**k off!!!
ReplyDeletewhy -32 and +32
ReplyDeleteThank you ☺️
ReplyDeleteGreat content and information. Thanks for sharing and Keep posting. Alternating case converter
ReplyDelete