WorksheetsCSI Coding Quiz
Total questions: 20
Worksheet time: 39mins
/
%
bitwise operator
*
10 5 3 4
10 5 4 4
10 5 3 3
10 5 4 3
int a = 10;
int b = a++ + ++a;
printf("%d %d %d %d",b , a++ ,a, ++a);
(a)
int a = 3;
printf("%d %d %d %d",++a , a++ ,a, --a);
(a)
(a)
44
55
1510
error
20
10
9
1
4 4
4 1
1 4
1 1
(a)
-65535 -65535
65535 -65536
-65535 65535
65535 65535
In a C Program if
int a = 5;
Int *ptr = &a;
then the printf statement with
&a, a, *ptr , ptr
adrress, Value, Value, Adress
address, value, value, value
all address
All values
In a C program,
int a = 20;
*ptr = &a;
**dptr = &ptr;
printf ("%d", **dptr);
prints
address of a
address of ptr
value of a
address of dptr
What does this command do?.
Creates a pointer of type integer that is initially pointing to null.
Creates a pointer of type integer that is initially pointing to 0.
Creates a pointer in the heap
None of the answers are valid
If ptr is a pointer variable pointing to an array, then
"printf("%d",*(ptr++)) ;"
statement will print :
Next location address
Next location index value
Next location value
Compile time error
What will be output?
int i=10;
int *p;
p=&i;
i+=5;
printf("\n i=%d *p=%d", i,*p)
i=10, *p=10
i=10, *p=15
i=15, *p=15
i=15, *p=10
Point out the compile time error in the program given below.
#include<stdio.h>
int main()
{
int *x;
*x=100;
return 0;
}
Error: invalid assignment for x
Error: suspicious pointer conversion
No error
None of the above
In Python, what serves as a reference to objects in memory, enabling dynamic memory management?
Pointer
Reference
Variable
Memory address
What will be the value of the following Python expression?
4 + 3 % 5
1.4
35
4
7
# include <stdio.h>
void fun(int *p){
*p = 10;
}
int main()
{
int y = 5;
fun(&y);
printf("%d", y);
return 0;
}
10
5
error
address
What will be the output of the following Python code?
1 2 3
error
12
None of the Mentioned
