100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Apsc 160 Final QUESTIONS AND VERIFIED ANSWERS ALREADY GRADED A+

Rating
-
Sold
-
Pages
16
Grade
A+
Uploaded on
07-10-2025
Written in
2025/2026

Apsc 160 Final QUESTIONS AND VERIFIED ANSWERS ALREADY GRADED A+

Institution
Course










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
October 7, 2025
Number of pages
16
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Apsc 160 Final 2025-2026 QUESTIONS AND
VERIFIED ANSWERS ALREADY GRADED A+


What does C language compiler do? - ANSWERStranslate from C into machine language



How do you declare a character variable containing the string? - ANSWERSEx: if variable is s and string is
foo=

char s[] = "foo";



What expression is always true? - ANSWERS|| = or, && = and, therefore, (p || !p) is always true



Global Variable - ANSWERSis accessible to any function that wants to use it



Local Variable - ANSWERSa specific type of variable that are only available within the context of a
particular expression and can only be accessed within the function that defines them.



Character variables in C are passed to functions... - ANSWERSby value



How to write Radius^2? - ANSWERSpow(radius, 2)



Steps to using a file in a program? - ANSWERS1. Open file with file pointer:

-File*inputFile;

-inputFile=fopen("file_for_opening.txt", "r" or "w");

2. Verify it was opened and print error if not:

-if(inputFile != NULL){} else {/*something went wrong*/ printf("Error opening input file\n");}

3. Using File (read or write):

,-fscanf((filepointer, extra parameter), formatstring, $var1, ..., &varN);

-fprintf(filepointer, formatstring, var1, ... , varN);

4. Close file:

-fclose(inputFile);



How to read from a file? - ANSWERSUse function: fscanf(filePointer, formatSpecifier, &var1, ..., &varN)



What happens when you write to a file? - ANSWERSIf it already contains data, that data will be over
written



Function for write data - ANSWERSfprintf(filePointer, formatString, &var1, ... , &varN)



How do you declare an array of unknown values? - ANSWERStype array [number]



How to declare an array of known values? - ANSWERStype array [] = {number1, number2,...}



Printing an array - ANSWERSprintf("%format",array[])



Pass-by-value mechanism - ANSWERSThe value of the actual parameter is copied and passed to the
formal parameter. It is used for primitive data types (int, char, double)



Pass-by-address mechanism - ANSWERSThe address of the actual parameter is passed to the formal
parameter. This permanently alters the actual parameter. Used for arrays with functions.



Event Controlled Loop - ANSWERSexecutes until some event occurs, you don't know ahead of time how
many times loop will execute (ex: while or do-while loops)



Counter Control Loop - ANSWERSexecutes a fixed number of times, you know ahead of time how many
times loop will execute (ex: for loops)

, Flow Chart Components - ANSWERSoval: start/end

arrow: connects components

parrallelogram: input/output

rectangle: process

diamond: decision



Binary Operators - ANSWERS&& and

|| or



Unary Operators - ANSWERS!= not



Boolean Expression - ANSWERSUses true or false evaluations with relation operators



Relation operators - ANSWERS< less than

> greater than

<= less than or equal to

>= greater than or equal to

!= not equal to

== equal to



Algorithm - ANSWERSunambiguous sequence of step-by-stpe instructions for solving a problem



When testing floating point values for accuracy we must give within a range because points cannot be
exact, what expression must we use? - ANSWERSex: num value is 0.3, within 0.0001 accuracy-

(fabs(num-0.3)<0.0001)



How to set up a for loop? - ANSWERSfor(initial_statement, booleanExpression; post_in/decrement)

initial: initiales variable

boolexp: true or false
$33.21
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
kirwadenno98

Get to know the seller

Seller avatar
kirwadenno98 Abingdon Whitney College, Abingdon
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
4 months
Number of followers
0
Documents
91
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions