What is the output of the following code?
int x = 5; if (x > 3) { printf("Greater than 3"); } else { printf("Not greater than 3"); }
Greater than 3
Not Greater than 3
Error
No Output
Variables of the same type
Variables of the different type
Functions and variables
Only functions
perror()
fprintf()
strerror()
printf()
sizeof(a)
sizeof(a[0])
sizeof(a) / sizeof(a[0])
sizeof(a) * sizeof(a[0])
-1
1
Null
EOF
They are compiled
They are replaced by their corresponding values
They are ignored
They are executed
Read
Write
Execute
Copy
malloc()
free()
calloc()
realloc()
Consider the following code and How many bytes of memory will be allocated?
int *ptr = (int *) malloc(10 * sizeof(int));
10 bytes
20 bytes
80 bytes
40 bytes
Input data
The program does not require any function.
Output data
The program must have at least one function.
What is the output of this statement
printf("%d", (a++));
The value of (a + 1)
Error message
Garbage
The current value of a
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
None of the above
break
continue
return
exit
In the following nested conditional statements, which branch will execute?
int x = 4; if (x > 2) { if (x < 5) { printf("x is between 2 and 5"); } } else { printf("x is 2 or less"); }
x is between 2 and 5
x is 2 or less
No output
The size of the largest member
The sum of the sizes of all members
Twice the size of the largest member
Size of the smallest member
How many times will the following loop execute?
int j; for(j = 1; j <= 10; j = j-1) printf("INFOMAX");
Forever
Never
0
10
break stops the loop, continue skips the rest of the iteration
Both stop the loop
break skips to the next iteration, continue exits the loop
Both skip to the next iteration
It breaks out of both loops.
It only breaks out of the innermost loop.
It causes a compile-time error.
It stops the program.
What will the following code print?
int x = 5; if (x = 0) printf("Zero"); else printf("Not zero");
Zero
Not zero
Compilation error
Program will terminate with an error
Undefined behavior
Array index will wrap around