stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Basics of C Flashcards | StudBud
Explore
/
Basics of C
Basics of C
15 terms
·
StudBud Administration
·
94 plays
Imported from external platform
Flashcards
15 cards
F
Practice quiz
P
Host live
L
Questions
15
Answers
1
Which of the following is not a character constant
‘Enter values of P,N,R’
’Thank you’
’23.56E-03’
All the above
2
char a = '0'; char b = 'A'; char result = a + b; printf("%c", result);
q
113
123
Error
3
What is the role of
printf
in C?
To perform mathematical operations.
To format and display output.
To read input from the user.
To declare variables
4
When are garbage values typically encountered in C?
When a program terminates.
When using the printf function.
When variables are declared and initialized.
When variables are declared but not initialized
5
C is a
middle level language
english language letter C
low level language
high level language
6
Which of the following code snippets is likely to produce a garbage value?
double price = 0.00;
int number = 42;
float pi = 3.14;
char character;
7
In C, what is the primary purpose of
const
?
To specify a variable's data type.
To declare a variable's scope.
To define a variable that changes frequently.
To define a variable that cannot be changed.
8
What is the result of the following code?
8.0
8.5
8
compilation error
9
Which of the following is not a valid variable name declaration?
int a_3;
int _3a
int _a3;
int 3_a
10
Which of the following is a valid C variable name?
const
123variable
first_name
my-variable
11
What is the format specifier for a single character in C?
%f
%c
%s
%d
12
what is output for printf("%c", result);
64
97
96
a
13
What is the result of the following code?
3
Compilation Error
3.14159265359
3.14
14
In C, how can you declare a constant integer with the value 10?
int constant = 10;
10 constant;
constant int = 10;
const int constant = 10;
15
what is output?
2.0
Compilation Error
2.5
2