stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Programming Fundamentals Flashcards | StudBud
Explore
/
Programming Fundamentals
Programming Fundamentals
51 terms
·
StudBud Administration
·
2 plays
Imported from external platform
Flashcards
51 cards
F
Practice quiz
P
Host live
L
Questions
51
Answers
1
Which of the following is a valid variable declaration in C?
int 2num;
float total;
char@name;
double = rate;
2
Which of these are required to declare a variable in C?
A variable name
A semicolon
All of the above
A data type
3
if-then:
A basic conditional statement. If the condition is true, execute the code in the "then" block.
False
True
4
When specifying decimal places for float, do the following:
%.#f
, with # signifying the number of decimal places.
True
False
5
The default case in a switch block must always come last.
False
True
6
default is optional in C switch statements, but using it is good practice to handle unexpected or unmatched values.
True
False
7
In C, the expression
float / int
results in a
float
value.
False
True
8
What is the output of this code?
Result: 4
Result: 6
Result: 5
Syntax Error
9
Post-increment prints original value, then increments.
False
True
10
What is the output of the following code?
10
11
12
Error
11
What does
%15.2lf
indicate?
left-aligned, 15 spaces for integer; 2 decimal places for float.
left-aligned, 2 spaces for integer; 15 decimal places for float.
right-aligned, 2 spaces for integer; 15 decimal places for float.
right-aligned, 15 spaces for integer; 2 decimal places for float.
12
What is wrong with the following code?
scanf() must come after printf()
Missing semicolon
Missing & before variable
Wrong format specifier
13
Top-Down Design
breaks a large problem into smaller, manageable sub-problems, making complex problems easier to solve.
True
False
14
return 0;
: Indicates successful completion of the program.
True
False
15
Pre-increment means
a
becomes
6
before multiplication.
True
False
16
What is a valid cast operation?
float = num
float num
num (float)
(float) num
17
Boolean Values in C:
True/False are represented as 1 (true) and 0 (false).
True
False
18
What is the result of this condition: (8 <= 3 || 5 > 2)
Error
Undefined
0
1
19
if (0) condition is always considered FALSE.
True
False
20
_____________ double PI = 3.141592653589;
double
float
const
#define
21
Which is
not
a key step in the Program Development Life Cycle?
Problem Definition: Understand the problem and define the requirements.
Graphic Design: Create visual assets for user engagement and branding.
Coding: Write the program code.
Maintenance: Update the program as necessary.
Design: Create an algorithm to solve the problem.
Testing: Verify that the program works correctly.
22
Without "break;" fall-through occurs after match.
False
True
23
A basic program structure looks like the following:
True
False
24
default can be placed anywhere; order doesn’t matter.
False
True
25
How should variables in C Programming be named? (Choose all that apply.)
Camel Case: Variable names use camel case (e.g., myVariableName).
Cannot contain spaces or special characters.
Descriptive and meaningful names are recommended.
Start with a letter or an underscore.
26
The scanf() function does not require the ampersand (&) symbol.
True
False
27
What is wrong in this switch-case block?
Missing default
Mixed data types in case labels
grade must be an integer
No curly braces
28
Use
tabs
for proper code indentation.
False
True
29
What does the following code print?
Three
TwoThree
No Output
ThreeDefault
30
What will this print?
True
False
Error
No output
31
What are
two
key concepts of Algorithm Development?
Use pseudocode to express an algorithm in plain language.
Test the algorithm on real users for feedback.
Install a compiler before designing an algorithm.
Use flowcharts for graphical representation of algorithms.
32
A float (single-precision) holds about
6
to
7 digits
of precision.
True
False
33
Ways to define constants is by using
const
or
#define
False
True
34
Identifiers must not start with digits or use special characters except underscores (_).
False
True
35
Pseudocode is code-like instructions that outline an algorithm’s logic without using specific syntax.
True
False
36
In C, the condition in an if statement is evaluated as true if non-zero, and false if zero.
False
True
37
When specifying
width
, place the number indicating spaces
after
a specifier.
True
False
38
What are the five basic actions fundamental to programming? (Choose 5.)
stop
get
put
←
if-else-then
#include
39
What is the result of the following?
15
50
5
10
40
Relational operators, like
==
,
!=
,
<
,
>
, evaluate to true (1) or false (0).
False
True
41
else is not needed at the end of if-else statements.
True
False
42
A
double
uses 64 bits, allowing for more precise values - around 15 to 17 significant digits.
True
False
43
A diagram that represents the steps of an algorithm is called a _____________.
Blueprint
Spreadsheet
Flowchart
Mind Map
44
=>
is a valid operator.
False
True
45
What are
compound assignments
in C?
Operators that assign memory addresses to variables
Special syntax for combining operations with assignment
Functions that return multiple values
Keywords used to declare multiple variables at once
46
What symbol assigns a value to a variable?
;
==
←
=
47
_____________ PI 3.141592653589;
const
#define
float
double
48
What is
#include
considered as?
A command that adds two numbers at compile time
A loop control structure
A preprocessor directive that includes the contents of another file
A function that runs before main()
49
What does the % operator mean?
Divide
Modulus
Increment
Subtract
50
\n
creates a New Line,
\t
creates a Horizontal Tab (usually every 8 character spaces)
True
False
51
For the following, what is the order based on
precedence
in C?
* → ++ → + → () → && → -=
() → ++ → * → + → && → -=
-= → () → * → + → ++ → &&
++ → * → + → && → -= → ()