Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7.10 Expression Evaluation In the 9th lecture of EECS2031-M, you have seen an example by which an expression that contains '+' was evaluated. In this
7.10 Expression Evaluation In the 9th lecture of EECS2031-M, you have seen an example by which an expression that contains '+' was evaluated. In this lab, you are to complete that example and write a recursion that evaluates an expression that contains both plus and minus sign. The function that you write is called total and gets three parameters including a string (an array of character) and two integers. At first call, the first integer has the value of O and the second integer points to the last element of the array. We know that the input string contains only one digit numbers, '+' and '-' with no white spaces. Sample input to total: ("6+1-2+3-7-2-3+5", 0, 14) corresponding output: 1 299436.1775812 LAB ACTIVITY 7.10.1: Expression Evaluation 0/5 main.c Load default template... 1 # include 2 # include 3 4 // insert your code here 5 int maino { char exp[1024] = "6+1-2+3-7-2-3+5"; 7 printf("%d ", total (exp. 0, strlen(exp) - 1)); 8 return 0; 9}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started