&&
| |
!
All of the above
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
signed short
unsigned short
long
int
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
results in a syntax error
output Infomax7
outputs garbage
outputs infomax and terminates abruptly
2
4
1
Depends on the system
for (i=1; i < 20; i++) printf ("k");
for (i=1; i = 20; i++) printf ("k");
for (i=0; i < 20; i++) printf ("k");
for (i=0; i <= 20; i++) printf ("k");
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.
*
&
%
#
Logical Operator
Conditional Operator
typecast
Ternary
30
32
36
40
Either True or False
is less than or is more than
is equal or less or more
It is used to define global variables
It is used to define a macro
It is used to include standard or user-defined header files in the program
It is used to include comments in the code
conio.h
string.h
math.h
graphic.h
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
-3.4e38 to 3.4e38
-32767 to 32768
-32668 to 32667
-32768 to 32767
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);}
0
Error because of incorrect line-1 only.
Error because of incorrect line-1 and line-2.
Error because of incorrect line-2 only.
||
What will be output if you compile and execute the following ‘C’ code?
void main(){int i=4,x;x=++i + ++i + ++i;printf("%d",x);}
21
18
19
Compilation error
ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
Id_No
ID_NO
IdNo
Id No
-1
Depends on array size
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Error
int a(char *s)
void b(int a[], int n)
float *c()
short d(long x)
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
Return
GOTO
Switch
exit
for loop
while loop
do-while loop
none of the above
Compiler
Interpreter
Assembler
None of These
int a = 5;printf("%d", a == 5);
5
pair of parenthesis
semicolon
braces
colon
break
continue
return
None of these
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
None of the above
Null
EOF
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
auto
case
main
default
no of students
char
7th
myName
immutable
mutable
const
volatile
float
double
char > int > float
int > char > float
char < int < double
double > char > int
Infinitely
Variable
Moves the file pointer to a specific location
Reads a file
Writes to a file
Closes a file
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
printf("\n");
echo '\n';
printf('\n');
printf('\\n')
An array of characters
The object of some class
Same as other primitive data type
Linkedlist of characters
int a = 10, b = 5;printf("%d", a / b);
0.5
15
2 bytes
4 bytes
8 bytes
1 byte
20
None
3