When the following piece of code is executed, what happens?
b = 3;a = b++;
a contains 3 and b contains 4
a contains 4 and b contains 4
a contains 4 and b contains 3
a contains 3 and b contains 3
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
None of the above
printf("\n");
echo '\n';
printf('\n');
printf('\\n')
volatile
true
friend
export
world
addition23
test-name
factorial
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
What is the output of the following code?
int a = 5, b = 10;if (a < b)printf("a is less than b");elseprintf("a is greater than or equal to b");
a is greater than or equal to b
a is less than b
Compiler Error
Undefined
-5
1
0
+5
4 Bytes
8 Bytes
Depends on the system/compiler
Cannot be determined
What is the output of the following code:
int x = 5;
printf("%d", x++);
4
5
6
An array of characters
The object of some class
Same as other primitive data type
Linkedlist of characters
It returns the size of the variable in bits
It returns the size of the variable in bytes
It returns the size of the variable in kilobytes
It returns the number of elements in an array
To exit the function and return control to the calling function
To pause the function temporarily
To call the function again
To exit the program
Constants
Keywords
Operators
Tokens
What will be the output of the following code?
int main(){int x,y,z;x='1'-'0'; /* line-1 */y='a'-'b'; /* line-2 */z=x+y;printf("%d",z);}
Error because of incorrect line-1 only.
Error because of incorrect line-1 and line-2.
Error because of incorrect line-2 only.
it Compare the variable a and the variable b are same.
The value of b is assigned to variable a but if b changes later, it will not effect the value of variable a.
The value of b is assigned to variable a but if b changes later, it will effect the value of variable a.
The value of variable a is assigned to variable b, and the value of variable b is assigned to variable a.
&&
| |
!
All of the above
Call by reference
Call by value
Call by reference by passing base address to a function
Both A and C
“programming Trick”
“programming"
‘programming'
$ programming $
char
int
float
double
LowerCase letters
UpperCase letters
CamelCase letters
None of these
scanf()
getch()
getche()
gets()
is executed only once if the conditions is true
is also known as entry-controlled loop
is executed at least once if the conditions is false
the unconditional loop
Assignment Relational Arithmetic
Arithmetic Relational Assignment
Relational Arithmetic Assignment
Assignment Arithmetic Relational
ctype.h
stdio.h
conio.h
math.h
"r"
"w"
"rw"
"read"
auto
case
main
default
2
3
Infinitely
Variable
int a = 10, b = 5;printf("%d", a / b);
0.5
15
8
16
return
static
new
10
20
None
Keywords can be used as variable names
Variable names can contain digits
Variable names do not contain blank spaces
Capital letters can be used in variable names.
&
||
Addition, Division, Modulus
Addition, Modulus, Division
Multiplication, Substration, Modulus
Modulus, Multiplication, Substration
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
-1
Depends on array size
for loop
while loop
do-while loop
none of the above
link, load, code, compile and execute
code, compile, link, execute and load
code, compile, link, load and execute
compile, code, link, load and execute
Read
Write
Execute
Copy
AT & Ts Bell Laboratories of USA in 1972
AT & Ts Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
function(int ptr);
function(int *ptr);
function(*ptr);
function(ptr *int);
immutable
mutable
const
break
continue
exit
main(){ int a, b; a=b=4; b=a++; printf("%d %d %d %d", a++, --b, ++a, b--);}
5 3 7 3
Syntax error
5 4 5 3
6 2 6 4
final
constant
main function arguments
main arguments
Command-Line arguments
Parameterized arguments