WorksheetsC Programming Basics - 003
Total questions: 10
Worksheet time: 4mins
An external variable is one
Which resides in the memory till the end of the program
Which is globally accessible by all functions
Which is declared outside the body of any function
All of the above
When applied to a variable, what does the unary "&" operator yield?
The variable's address
The variable's right value
The variable's binary form
The variable's value
The operator "&" is used for
Bitwise AND
Bitwise OR
Logical AND
Logical OR
Which are built-in data structures in C programming?
Arrays
Structures
Files
All of the above
The size of a character variable in C is
8 bytes
4 bytes
2 bytes
1 byte
An expression contains relational, assignment and arithmetic operators. If parenthesis are not specified, the order of evaluation of the operators would be:
assignment, arithmetic, relational
relational, assignment, arithmetic
assignment, relational, arithmetic
arithmetic, relational, assignment
Given two literals 0x001B and 033. What are these equal to?
21 and 23
27 and 33
33 and 33
27 and 27
What is the outpur of the following code segment (assuming sizeof(int) returns 4)?
int i=0x1 << sizeof(int) * 8-1;
printf("\n%x", i);
i = i >> sizeof(int) * 8-1;
printf("%d", i);
0x8000000-1
80000000-1
-1 0x0000000
-1 0000000
Which is the correct sequence statements that swaps values of two statements?
a=a+b; a=a-b; b=a-b;
a=a+b, b=a-b; a=a-b;
a=a-b; a=a+b; b=b-a;
None of these
Choose the option that contains only Unary operators of C:
sizeof, (type conversion)
short hand operator, &
increment(++), >=, !
==, !=
