Question: 1 . ALGORITHM TO FIND WHETHER GIVEN STRING IS IDENTIFIER OR NOT Start Declare ij , flag - I,len as int and str { 1

1. ALGORITHM TO FIND WHETHER GIVEN STRING IS IDENTIFIER OR NOT
Start
Declare ij,flag-I,len as int and str{10] as char
3. Allow the user to enter the string
Initialize the loop Oj-1 to islen
if stril is digit, assign flag O
else if stri] is alphabet, increment flag
D) if strfi] is alphanum, increment flag
2) else if stri] is not digit, assign flag O
3) else increment flag
d. else if stri] is not alphanum, assign flag-0
S. if Mag-O, print Identifier else print Not Identifier
Stop
2. ALGORITHM TO FIND WHETHER GIVEN STRING IS CONSTANT OR NOT
1. Start
2. Declare i, flag as int and a(5] as char
3. Allow user to enter the value
4. Initialize the loop from i-0 to strien(a)
a. if ali) is digit, assign flag-I
b. else assign flag-O
S. if flag-=1, print Value is Constant else print Value is Variable
6. Stop
Output
Enter the value :
123
Value is constant
Enter the value :
vikas
Value is a variable
3. YOU NEED TO GENERATE A CALCULATOR PROGRAM USING BOTH LEX AND YACC.
The calculator should support Division, Multiplication, Addition, Subtraction, and power operation in proper
precedence and associativity. The calculator should also support first bracket with the expression

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!