Engineering > QUESTIONS & ANSWERS > SAN JOSÉ STATE UNIVERSITY E10 Introduction to Engineering Page 1 of 4 Homework #3 Spring 2022 (All)
SAN JOSÉ STATE UNIVERSITY E10 Introduction to Engineering Page 1 of 4 Homework #3 Spring 2022 1. (6 pts) What are the value of the variables ‘A’ and ‘B’ at end of the following program? Show ... your reasoning. Void main (void) { int A; int B; int C; A=5; B=2; C=A*B; A=C*2; B=A/4; C=A - B; if ((C – B<A) { A=5; B=C;} else { A=6; B=0; } 2. (6 pts) What is the value of the variable ‘A’ at end of the following program? Show your reasoning. Void main (void) { int A; int COUNT; A=1; COUNT=0; while (COUNT < 4) { if (COUNT<2) { A=A+4; } else { A=A+COUNT; } COUNT = COUNT +1; 3. (6 pts) Find and indicate all of the errors in the following program. (Hint: one of the errors has to do with an unwanted infinite loop) void main(void) { int P; int Q; int R; P = 30; Q = 0; R= 4; if ( P > R;) { Q = R - P; R= 0; if ( Q=0) { S = P + Q +R ;} P =2; while (P <20) { S=P+1; Q=Q+1; R= R+1 [Show More]
Last updated: 2 years ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Apr 28, 2023
Number of pages
4
Written in
All
This document has been written for:
Uploaded
Apr 28, 2023
Downloads
0
Views
81
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·