Escolar Documentos
Profissional Documentos
Cultura Documentos
QuestionText
AnswerText1
AnswerText2
unalloc()
dropmem()
"My salary was increased by 15%!" . Select the statement printf("\"My salary was printf("My salary
What is a difference between a declaration and a definition Both can occur multipleThere is no differ
3
22,10,11,13
0
10
1, 2, 3, 4, 5, 5,
4, 3, 2, 1, 0, 0,
11
12
13
memset()
22
26
14
15
int var1;If a variable has been declared with file scope, as Yes; it can be referenceNo; it would have t
16
time( &t );
17
Which one of the following provides conceptual support for The system stack
18
Procedural
Machine
19
20
21
22
efg
-4: 4 -3:3
23
24
Which one of the following will declare a pointer to an int int *x;*x = 0x200;
int x = 5;int y = 2;char op = '*';switch (op){ default : x += 1;
case '+' : x += y; /*It will go to all the cases*/case '-' : x -=
y;
}After the sample code above has been executed, what
value will the variable x contain?
int *x = &0x200;
4
25
x = 3, counter = 0; while ((x-1)){++counter;x--;} Referring
to the sample code above, what value will the variable
counter have when completed?
26
char ** array [12][12][12]; Consider array, defined above.
Which one of the following definitions and initializations of
p is valid?
27
29
30
Which one of the following is a true statement about pointe A pointer of type void Standard C mandate
6
31
32
33
@@
34
How do printf()'s format specifiers %e and %f differ in thei %e always displays an %e expects a corre
35
fseek()
36
Which one of the following will read a character from the key
c = getc();
getc( &c );
||
38
39
40
41
How do you include a system header file called sysheader.h#include <sysheader.h #incl "sysheader.h
42
%4.30e
43
x=1
44
x=0
1, 2, 4
46
penny = one, nickel = five , dime = ten, quarter = twenty-fi enum coin {(penny,1), (n
enum coin ({penny,1
11 bytes
12 bytes
48
z=0.00
z=1.00
49
go_cart
go4it
51
52
if (x == 0) return 0;
return 1;
54
55
When applied to a variable, what does the unary "&" operatThe variable's value
56
auto
57
feof( f )
59
___S
1___
60
Unspecified
61
Which one of the following is valid for opening a read-only fileOpen (filenm, "r");
62
FILE *f;
63
output()
64
65
127 128
5123456789
5123456789
0123456789 56789
67
68
How does variable definition differ from variable declaratio Definition allocates sto Declaration allocat
int x[] = {1, 2, 3, 4, 5}; int u; int *ptr = x; ???? for( u = 0; u
< 5; u++ ) { printf("%d-", x[u]); } Which one of the following
statements could replace the ???? in the code above to
cause the string 1-2-3-10-5- to be printed when the code
is executed?
*ptr + 3 = 10;
*ptr[ 3 ] = 10;
69
-4000
1 -- 1 1 -- 1
-400
1 -- 1 2 -- 1
70
struct node *nPtr, *sPtr; /* pointers for a linked list. */ for
(nPtr=sPtr; nPtr; nPtr=nPtr->next)
{ free(nPtr);} The sample code above releases memory
from a linked list. Which of the choices below accurately
describes how it will work?
71
72
fileread()
73
What is a proper method of opening a file for writing as binaFILE *f = fwrite( "test.biFILE *f = fopenb( "t
74
Which one of the following functions returns the string repr localtime
gmtime
76
77
78
Which one of the following is a true statement about pointe They are always 32-bit For efficiency, poi
void
freeList( struct
nodeported
*n ) { while(
n ){ ???? } }No
Which
/*sum_array()
has been
from FORTRAN.
*
one of the
following
replace
thedouble
???? for the function
logical
changes
havecan
been
made*/
above to release the
memory
sum_array(double
d[],int
n) allocated to a linked list?
{ register int i;double total=0;
assert(d!=NULL);
for(i=l;i<=n;i++)
total+=d[i];
return total; } The function sum_array(), defined above,
contains an error. Which one of the following accurately
describes it?
struct node m =
n;n = n->next;
free( m );
n = n->next;free( n );
13
80
Hello
Hello5
81
100
101
82
83
84
85
1,2,4,5
86
11.26
87
Hello , 6
88
12345
89
#include<stdio.h>int main(){int
i;for(i=3;i<15;i+=3);printf("%d",i);return 0}
Error
3 6 9 12
90
#include<stdio.h>int main(){int
i;printf("%d",scanf("%d",&i));return 0;}
Error
Unpredicted
100
Garbage Value
Stray Pointer
Invalid Pointer
10.36
91
What is EOF
EOF is a macro
whose body is 0 and
defined in stdio.h
92
Redeclaration Error
10
93
Error
44
94
Unpredicted
Error
95
16
96
Unpredicted
Error
97
x - = y + 1;means
x=x-y+1
x=-x -y -1
98
11, 11, 11
99
RunTimeError
Syntax Error
EOF is a non
constant whose
value is 0
255
256
16
2^16-1
2^15-1
maximum of a , b
positive
difference of a,b
C provides no file
access features
-1
" ?: "
" += "
prints 8
prints 6
232
Unpredicted
#include<stdio.h>int main(){char
111 ch=1000;printf("%d",ch);return 0;}
negative value
Unpredicted
It is assumed to be
present and taken to
be false
It is assumed to
be present and
taken to be true
static_const
pragma
An Array with 3
columns per row
50
Garbage Value
Garbage Value
Error
During external
variable defination,
storage is set aside
by the compiler
Error(main is not
recurssive)
keeps printing
Hello
Code Reusability
Modularity
1,2,3
132 printf("abc","def","ghi");
abcdefghi
Error
malloc(m*n,0);
memset(0,m*n);
AP
TN
101
incremented
Address
no type checking
will be done
enum variables
can be compared
10
It is a collection of
items that share a
common name
0
It is a collection of
items that share a
common name
and occupy
consecutive
memory locations
Empty
second();putchar(
'a');
5 5
4 5
the datatype
the scope
8 8
147 puts(argv[0])
Error
ComeCome
Error
Array Address
Error
0 bytes
Error
Segmentation
Fault
Garbage Value
Error
#include<stdio.h>void main(){char
154 str[]="wel0come";printf("\n%s",str);}
Error
wel0come
#include<stdio.h>void main(){char
155 str[]="wel\0come";printf("\n%s",str);}
Error
wel0come
1,1
4,4
*(a+i+j)
*a(i+j)
Error
fopen("emp.txt","r
fopen("emp.txt","w+"); +");
by including the
by defining the
contents of that file in variable static in
the current file
the current file
scanf is delimited
by end of line,
while gets is not
prints 263
prints ASCII
equivalent of 263
Garbage Value
-3
a is a structure
and b is a pointer
a and b are structures to a structure
memory space
will not be wasted
20
is a structure
declaring the
sizes of the
is a field having many members in
sub-fields
terms of bits
default case, if
used should be
the last case
176 C is a
low level
language
puts("hello");
puts(hello);
Segmentation
fault
when initialized is a
part of defination
when it is a
declaration
the first(row)
subscript may be
left empty
assigns address
of c to a
Integer DataType
Character
DataType
AnswerText3
xt4
10
11
CorrectAnswer
Topic
3
C & Data
Structures
dealloc()
free()
C & Data
Structures
C & Data
1 Structures
y = LLO
C & Data
4 Structures
y = LO
C & Data
4 Structures
C & Data
4 Structures
11
C & Data
Structures
22,11,11,11
22,13,13,13
C & Data
4 Structures
3
C & Data
Structures
5, 4, 3, 2, 1, 0,
0, 0, 1, 2, 3, 4
14
C & Data
4 Structures
4
C & Data
Structures
MAX_NUM is a precompile
MAX_NUM is a
C & Data
4 Structures
strncpy()
C & Data
4 Structures
memmove()
46
50
C & Data
Structures
C & Data
4 Structures
t = ctime();
C & Data
1 Structures
t = localtime();
C & Data
1 Structures
Assembly
C & Data
2 Structures
Object-orient
C & Data
Structures
3
C & Data
Structures
3
C & Data
Structures
defg
cdefg
-4: 3 4:3
-4:3 -3:4
C & Data
1 Structures
C & Data
Structures
int *x = *0x200;
int *x = 0x200
6
C & Data
1 Structures
3
C & Data
Structures
3
C & Data
Structures
C & Data
1 Structures
C & Data
1 Structures
C & Data
1 Structures
C & Data
4 Structures
12
24
C & Data
Structures
C & Data
4 Structures
AND.
C & Data
4 Structures
&&
C & Data
1 Structures
ferror()
feof()
C & Data
4 Structures
c = getchar( stdin );
c = getchar();
C & Data
4 Structures
C & Data
4 Structures
10
C & Data
Structures
>
C & Data
Structures
C & Data
2 Structures
C & Data
1 Structures
%-4.30f
%-30.4f
C & Data
4 Structures
x=4
x=5
C & Data
4 Structures
1, 2, 8
2, 2, 4
C & Data
4 Structures
C & Data
Structures
C & Data
4 Structures
13 bytes
20 bytes
C & Data
4 Structures
z=1.50
z=2.00
C & Data
2 Structures
4season
run4
C & Data
3 Structures
It is illegal to initialize
C & Data
2 Structures
C & Data
4 Structures
C & Data
1 Structures
if (x >= 2) return 2;
if (x <= 1) retu
C & Data
4 Structures
C & Data
1 Structures
The variable'
C & Data
4 Structures
bigNumber
g42277
C & Data
2 Structures
eof( f )
f == NULL
C & Data
1 Structures
C & Data
4 Structures
___1
S___
C & Data
2 Structures
float
double
C & Data
3 Structures
C & Data
4 Structures
int f;
struct FILE f;
C & Data
2 Structures
dump()
write()
C & Data
1 Structures
255
32767
C & Data
Structures
C & Data
Structures
56789 0123 4
C & Data
Structures
56789 56789
-40
0.004
C & Data
1 Structures
C & Data
4 Structures
*(ptr + 3) = 10;
(*ptr)[ 3 ] = 10
C & Data
3 Structures
1 -- 1 2 -- 2
1 -- 1 1 -- 2
C & Data
1 Structures
This is invali
C & Data
2 Structures
readfile()
fread()
C & Data
4 Structures
C & Data
4 Structures
strtime
C & Data
4 Structures
ctime
C & Data
2 Structures
C & Data
1 Structures
struct node m =
n;free( n );
n = m->next;
free( n );n =
n->next;
C & Data
2 Structures
19 25
C & Data
1 Structures
C & Data
Structures
Garbage Value
Error
C & Data
Structures
Error
None
C & Data
Structures
C & Data
Structures
C & Data
Structures
Dangling Pointer
Pointer
without
allocation
C & Data
Structures
0,1,2,3,4,5
1,2,3,4,5
C & Data
Structures
11.25
Error
C & Data
Structures
Error
C & Data
Structures
Error
C & Data
Structures
15
C & Data
Structures
Run Time
Error
C & Data
Structures
address of i
999
EOF is a structure
variable
EOF is an
end of file
character
C & Data
Structures
Unpredicted
20
C & Data
Structures
300
Unpredicted 2
C & Data
Structures
10
C & Data
Structures
Error
Unpredicted 1
C & Data
Structures
C & Data
Structures
x=-x+y+1
x=x-y-1
C & Data
Structures
10 , 10 , 11
None
C & Data
Structures
C & Data
Structures
127
none
C & Data
Structures
10
C & Data
Structures
C & Data
Structures
2^15
2^16
C & Data
Structures
sum a,b
minimum of
a,b
C & Data
Structures
All the
options
C & Data
Structures
Unpredictable
none
C & Data
Structures
C & Data
Structures
" = "
All the
options
C & Data
Structures
prints 6 or 8 depending
on the compiler
implimentation
syntactically
wrong
3
C & Data
Structures
Error
1000
C & Data
Structures
Error
1000
C & Data
Structures
C & Data
Structures
C & Data
Structures
C & Data
Structures
Syntax Error
Execution
will bw
terminated
abruptly
volatile
immutable
C & Data
Structures
undefined
declaration
leads to an
error
C & Data
Structures
C & Data
Structures
C & Data
Structures
More than
one double
dimenssional
Array
4
C & Data
Structures
C & Data
Structures
C & Data
Structures
Error
40
C & Data
Structures
50
10
C & Data
Structures
is compiler dependent
will be
decided at
runtime
C & Data
Structures
All the
options
C & Data
Structures
All the
options
C & Data
Structures
All the
options
C & Data
Structures
C & Data
Structures
C & Data
Structures
C & Data
Structures
0 , 1, 2
Garbage
C & Data
Structures
abc
none
C & Data
Structures
excludes string of
characers within double All the
quotes
options
C & Data
Structures
C & Data
Structures
p=malloc(m*
p=malloc(m*n);memset( n);
p,0,m*n);
strcpy(p,0); 3
C & Data
Structures
AP , TN
MP,TN
C & Data
Structures
Error
100
C & Data
Structures
All the
recursion is not possible options
C & Data
Structures
Enumeration feature
does not increase the
power of C
C & Data
Structures
C & Data
Structures
C & Data
Structures
C & Data
Structures
5 4
4 4
C & Data
Structures
the scope ,
permanence
and datatype 3
C & Data
Structures
All the
options
12
11
It is a collection of items
of the same type and
storage class that share
a common name and
occupy consicutive
none of the
memory locations.
above
C & Data
Structures
888
none of the
above
C & Data
Structures
Error
prints
number of
command
line
arguments
C & Data
Structures
Come Come 2
C & Data
Structures
garbage
value
C & Data
Structures
4bytes
Depends on
compiler
implementati
on
4
C & Data
Structures
Error
none
C & Data
Structures
300
44
C & Data
Structures
none of the
above
C & Data
Structures
44
C & Data
Structures
C & Data
Structures
4,8
Unpredicted 3
C & Data
Structures
*(*(a+i)+j)
((a+i)+j)
C & Data
Structures
Base Address
segmentatio
n fault
3
C & Data
Structures
fopen("emp.txt","a+");
fopen("emp.t
xt","w");
2
C & Data
Structures
C & Data
Structures
C & Data
Structures
&
All the
options
C & Data
Structures
scanf is delimited by
blank space, while gets none of the
is not
above
C & Data
Structures
C & Data
Structures
C & Data
Structures
a is a pointer
to structure
in which b is
a field
4
C & Data
Structures
garbage
value
a is a pointer to a
structure and b is a
structure
C & Data
Structures
none of the
above
C & Data
Structures
is member of a structure
whose size is specified none of the
in terms of bits
above
C & Data
Structures
C & Data
Structures
C & Data
Structures
C & Data
Structures
C & Data
Structures
C & Data
Structures
can't always be
replaced by a nested ifthen-else clause
both a and b 4
C & Data
Structures
low level
language
with some
high level language with high level
some low level features features
C & Data
Structures
C & Data
Structures
printf("%s\n","hello");
C & Data
Structures
none of the
above
C & Data
Structures
when it is a formal
parameter
C & Data
Structures
none of the
above
both the
subscripts
must be left
empty
C & Data
Structures
C & Data
Structures
Unsigned Integer
DataTypes
C & Data
Structures
none of
these
Sno
QuestionText
AnswerText1 AnswerText2
AnswerText3
in while condition is
checked first
where as in do
while condition is Only Syntactical
checked last
Difference
No difference
It is setting the
It is taken care of compiler option
by the compiler conditionally
It is compiling a
program based on
a condition
Casting refers to
Explicit type
conversion
Constant
expressions are
evaluated at
compile time
an array argument
String constants
can not be
concatenated at
compile time
Size of an array
must be known at
compile time
as a datatype of
a function that
returns nothing
to its calling
environment
an array
The number of
subscirpts
determines the
dimension of the
array
before the
recognition of
escape characters
in strings
The array
elements need
not be of the
same storage
class
the variable is
recognized only in
the file in which it if it results in a
defined
syntax error
inside the brackets
of a function that
does not needany
arguments
in an expression
10
reduces
execution time
It is possible for
a function to
access a
variable that is
Which of the following statements local to another
are correct
function
increses
reduces code size execution time
The scope of a
local variable
should be a
function
In an expression involving ||
operator,evaluation
will be stopped if
one of its
components
evaluates to
false
will be stopped if
one of its
components
evaluates to true
14
15
a field can be
unnamed
a field can be of
width 0
16
Address
operator cannot Address operator
be applied to
can be applied to
register variables register variables
17
11
12
13
arithmetic
expressions
Misuse of register
declaration will
increase the
execution time
members of a
structure
AnswerText4
CorrectAnswer
Topic
In do while statements
will be executed atleast
once
2,4
C & Data
Structures
3,4
C & Data
Structures
Coercion refers to
Explicit type conversion
2,3
C & Data
Structures
1,2,3
C & Data
Structures
none
1,3
C & Data
Structures
1,3
C & Data
Structures
In an array defination,
the subscript can be any
expression yielding a
non-zero integer value
1,2
C & Data
Structures
1,2
C & Data
Structures
in a printf statement
1,2
C & Data
Structures
1,4
C & Data
Structures
C & Data
Structures
1,2
C & Data
Structures
2,4
C & Data
Structures
2,3
C & Data
Structures
C & Data
Structures
1,3
C & Data
Structures
local variables
1,2
C & Data
Structures