WorksheetsQuiz 2
Total questions: 12
Worksheet time: 10mins
Which one is valid variable declaration?
int 1person;
int 1 person;
int person_1;
int person 1;
Fill in the blanks to print the output "65432"
for(int i=6;i_1;i--) {
printf("%d",i); }
(a)
Predict the output.
Sum is 5.7
Sum is 5
Sum is 0
Compiler error
Choose the correct output.
2
4
6
8
0
2
4
6
8
2
4
6
8
Garbage value
Compiler error
Which of these are possible array declarations?
(choose more than one answer)
int ar[]={1,2,3};
int ar[3]={0,1,2};
int ar[ ];
int ar[50];
Write the dimension of the given array.
Answer format Example:
2,5
(a)
Predict the output.
56789
5678910
5
error
Guess the output.
Fail
Very good
Very good
Compiler error
Very good
Fail
Guess the correct format specifiers.
%d
%d
%p
%d
%p
%p
%d
%p
%d
%p
%p
%p
Which of the following is the proper declaration of a pointer?
int x*;
int &x;
ptr x;
int*x;
Which of the following gives the memory address of integer variable a?
*a;
**a;
&a;
address(a);
Predict the size of the string.
12
13
14
15
