Evolution of C – from past to eternity M1 Test
-
The
_Pragma
keyword may be used in the following syntax context:_Pragma( string_literal
_Pragma( )
_Pragma( variable_name )
_Pragma( integer_constant )
-
The following statement:
%:include <stdio.h>
- is invalid
- contains a specialized preprocessor directive
- contains reserved identifiers
- contain a digraph
-
If the compiler conforms to the ISO standard, its preprocessor defines a symbol named:
__ISO_C__
__STD_C__
__STDC__
__ISOC__
-
The following symbol may(in certain circumstances) be taken as an equivalent of:
<:
- a hash
- a tilde
- a parenthesis
- a bracket
-
The two following declarations of the
main()
function:int main(void) { ... } int main() { ... }
- aren’t equivalent and the latter is highly recommended
- aren’t the same, but are equivalent
- are the same
- aren’t equivalent and the former is highly recommended
-
Using the older style of function declaration (as below) is:
float sinf(x) float x; { ... }
- very convenient as it is more concise than the modern style
- highly recommended as it is more elegant
- very risky as the compiler checks neither the number of arguments nor their types
- a matter of tradition and good taste
-
Which of the following statements is true?
- trigraphs are not recognized inside string literals, but digraphs are
- both trigraphs and digraphs are not recognized inside string literals
- both trigraphs and digraphs are recognized inside string literals
- trigraphs are recognized inside string literals, but digraphs aren’t
-
The term “EBCDIC” refers to data of type:
float
double
void
char
-
Values of the
_Bool
data type behave as:- signed
ints
- signed
long ints
- unsigned
ints
- unsigned
long ints
- signed
-
The
atexit()
function:- may not be invoked when the
_Exit()
function is utilized - may not be invoked when the
exit()
function is utilized - may not be invoked more than once
- may be invoked more than once
- may not be invoked when the
-
The following symbol may(in certain circumstances) be taken as an equivalent of:
??-
- a hash
- a bar
- a tilde
- an underscore
-
Which of the given examples is an older equivalent of the function declaration?
void f(int n, int m) { return n * m; }
void f(n, m) int, int { return n * m; }
void f(int, int) n,m { return n * m; }
void f(n,m) int n; int m; { return n * m; }
void f(int n, m) { return n * m; }
-
Which of the following statements is true?
- trigraphs are recognized inside string literals, but digraphs aren’t
- trigraphs are not recognized inside string literals, but digraphs are
- both trigraphs and digraphs are not recognized inside string literals
- both trigraphs and digraphs are recognized inside string literals
-
An empty pair of parentheses put in a function declaration denotes that the function:
void f(int n, int m) {return n * m;}
- should be invoked with exactly one argument
- should be invoked without any arguments
- should be invoked with no more than three arguments
- may be invoked with any number of arguments
-
The size of the following structure is:
struct stru{ char a; double b; };
- equal to the greater of these two:
sizeof(char), sizeof(double)
- equal to
sizeof(char) + sizeof(double)
- equal to or greater than
sizeof(char) + sizeof(double)
- equal to the lesser of these two
sizeof(char), sizeof(double)
- equal to the greater of these two:
-
The
__func__
symbol is a:- constant
- variable
- function
- preprocessor symbol
-
The use of trigraphs may be necessary if:
- you write a program for a nob Latin writing system, like Kanji
- you write a program for a non English speaking customer
- the encoding system used by your hardware doesn’t contain some of the needed symbols
- your hardware is too old to adopt modern removable media
-
The result of the following expression:
int n ='z' 'a';
- depends on the encoding system used by a specific hardware platform
- is always
26
- is always
25
- is always
27
-
Hardware using little endian representation will store a 16-bit
long int
value equal to17
as (bytes at lower addresses are presented first, all bytes in hex):11 00
10 10
00 11
01 01
-
If a function does not return to its invoker, is should be declared with the following specifier:
Noreturn
noreturn
_Noreturn
_noreturn
Subscribe
0 Comments
Newest