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
4 Bytes
8 Bytes
Depends on the system/compiler
Cannot be determined
2 bytes
4 bytes
8 bytes
1 byte
scanf()
getch()
getche()
gets()
ctype.h
stdio.h
conio.h
math.h
start()
printf()
main()
int arr[10][10];
int arr[10,10];
array int arr[10][10];
int arr{10}{10};
Compilation error
Program will terminate with an error
Undefined behavior
Array index will wrap around
-3.4e38 to 3.4e38
-32767 to 32768
-32668 to 32667
-32768 to 32767
1
2
4
8
double
float
char
array
What is the output of this statement
printf("%d", (a++));
The value of (a + 1)
Error message
Garbage
The current value of a
What is the output of the following code:
int x = 5;
printf("%d", x++);
5
6
Undefined
0
Infinitely
Variable
Return
GOTO
Switch
exit
3
string.h
graphic.h
An Editor
A compiler
An operating system
None of these
put together the file and functions that are required by the program
translate the instructions into a form suitable for execution by the program
load the executable code into the memory and execute them
allow the user to type the program
What is the output of the following code?
int a = 10, b = 5;printf("%d", a / b);
0.5
15
world
addition23
test-name
factorial
for loop
while loop
do-while loop
none of the above
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
results in a syntax error
output Infomax7
outputs garbage
outputs infomax and terminates abruptly
switch
goto
go back
return
arr[2]
arr(2)
arr[3]
arr[1]
*
&
%
#
-1
Decimal
Binary
Octal
Hexadecimal
They can contain alphanumeric characters as well as special characters
It is not an error to declare a variable to be one of the keywords(like goto, static)
Variable names cannot start with a digit
Variable can be of any length
To determine which operator evaluated first from left to right.
To determine the level of an operator in a program.
To determine how an expression involving more than one operator is evaluated.
To check the expression is valid or not.
void
endl
A number
A special symbol other than underscore
Both of the above
An alphabet
//
/
/*
int arr[5] = {1, 2, 3, 4, 5};printf("%d", arr[3]);
1return
return1
$return_1
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
-4
-2.8
+2.8
+3
malloc()
free()
calloc()
realloc()
do-while
if-else
for
while
16
How many times will the following loop execute?
int j;for(j = 1; j <= 10; j = j-1)printf("INFOMAX");
Forever
Never
10
2.5
2.000000
2.500000
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Error
break
continue
What will be the output of the following pseudo code ?
Integer aSet a =4do print a + 2 a = a-1while (a not equals 0)end while
6 6 6 6
6 5 4 3
6 7 8 9
6 8 10 12
int x = 5;if (x > 3) { printf("Greater than 3"); } else { printf("Not greater than 3"); }
Greater than 3
Not Greater than 3
No Output
long double
far double