New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



TOKEN SEPARATION


Posted Date:     Total Responses: 0    Posted By: RoseNinja   Member Level: Gold   Points/Cash: 4   


#include
#include
void main()
{
int chr=0,num=0,symb=0,J=0,R=0,oper=0;
int n;
char c;
FILE *abt;
abt=fopen("file.txt","w");
printf("\n Enter the Expression");
while((c=getchar())!='\n')
fputc(c,abt);
fclose(abt);
abt=fopen("file.txt","r");
while(!feof(abt))
{
c=getc(abt);
n=toascii(c);
if(n>64&&n<91||n>96&&n<122)
chr++;
if(n>47&&n<58)
num++;
if(n==33||n==37||n==42||n==43||n==45||n==47)
oper++;
else
if(n>32&&n<48)
symb++;
if(n==40)
J++;
if(n==41)
R++;
}
fclose(abt);
printf("\n The given expression contains");
printf("\n operands %d\n constants %d\n symbol %d\n operator %d\n",chr,num,symb,oper);
if(J==R)
printf("Paranthesis is balanced");
else
printf("Paranthesis is unbalanced");
}


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: FIRST COME FIRST SERVE SCHEDULING
Previous Project: Grow a plant in bottle and emergence of root from plant cut stem

Return to Project Index

Post New Project


Related Projects






Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

AdSense Revenue Sharing sites

ISC Technologies.
2006 - 2009 All Rights Reserved.