Answered step by step
Verified Expert Solution
Link Copied!

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:};

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Do you hold grudges or do you let go of things easily?

Answered: 1 week ago