Answered step by step
Verified Expert Solution
Question
1 Approved Answer
20. If there are the following descriptions and statements, the value of 1002 in the following expression is (). struct student{ int num; int age:};
20. If there are the following descriptions and statements, the value of 1002 in the following expression is (). struct student{ int num; int age:}; struct student stu[3]={{1001,20). {1002,19). {1003,21}}. *p=stu+2; A. (P--)->num B. (--p)->num C. (*p).num D. (*p).num-- Obtained Points case Title Two: Fill the blanks K2 points per blank, and total 20 points (write only an expression or a statement per bla nk) (1) Procedures to add, subtract, multiply, divide the integer four operations. For example, input 12*5, output 12*5=60 #include int maino { int a,b,d; char ch; printf("Please input a expression:"); scanf("%d%c%d", &a,&ch,&b): switch(ch) { case'+: d=a+b; printf("%d+%d=%d n".a.b.d); break; case ': d=a-b; printf("%d-%d=%d n".a.b.d); break; **: d=a*b; printf("%d*%d=%d ".a.b.d); break; case ': if (1) printf("The divisor is 'n"); else printf("%d%d="fn".a.b. (2) ab); break; default : printf "Input Operator error!'n"); } } (2) Monkeys eat peaches. Little monkey one day picked a number of peaches. It was greedy and that dayate half more than one: The next day he ate more than one half of the remaining peach; This happened every dayuntil, on the seventh day, there was only one left. How manypeaches did the monkey pick that day? Supplement and perfect the program to realize its function #include int maino { int day=7.x2
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