PTASAPTASA
Slide 1 Slide 1
Slide 2 Slide 2
Slide 3 Slide 3
Slide 4 Slide 4
Slide 5 Slide 5
<
>

DAE CIT-113 CH-09 MCQs

DAE | CIT-113

INTRODUCTION TO COMPTER PROGRAMMING 

CHAPTER : 09

DIPLOMA OF ASSOCIATE ENGINEERING

EXAM PRAPARATION

COMMON WITH:
COMPUTER INFORMATION TECHNOLOGY

MULTIPLE CHOICE QUESTION

Chapter:09 (Pointers)

Question 1:

Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0;)?

Question 2:

Which is an indirection operator among the following?

Question 3:

What will be the output of the following C code?
1. #include <stdio.h>
2. void main()
3. {
4. int x = 0;
5. int *ptr = &5;
6. printf("%p\n", ptr);
7. }

Question 4:

Comment on the following pointer declaration:
int *ptr, p;

Question 5:

Comment on the following C statement.
const int *ptr;

Question 6:

What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
printf("%p\t%p", p, a);
}

Question 7:

What will be the output of the following C code?
#include <stdio.h>
int main()
{
int ary[4] = {1, 2, 3, 4};
printf("%d\n", *ary);
}

Question 8:

What are the different ways to initialize an array with all elements as zero?

Question 9:

What is the size of *ptr in a 32-bit machine (Assuming initialization as int *ptr = 10;)?

Question 10:

What is the correct way to declare and assign a function pointer? (Assuming the function to be assigned is "int multi(int, int);")

Question 11:

Comment on the following C statement.
int (*a)[7];

Question 12:

Comment on the output of following code:
#include <stdio.h>
main()
{
char *p = 0;
*p = 'a';
printf("value in pointer p is %c\n", *p);
}

Question 13:

An entire array is always passed by ___ to a called function.

Question 14:

What is the ASCII value of NULL or \0.?

Question 15:

Choose the best answer.
Prior to using a pointer variable.

Question 16:

The statement int **a;

Question 17:

Which of the following is the correct way of declaring a float pointer:

Question 18:

Find the output of the following program.
void main()
{
char *msg = "hi";
printf(msg);
}

Question 19:

What is the base data type of a pointer variable by which the memory would be allocated to it?

Question 20:

{char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;}


NOTE
If you find any mistake in them, do tell in the comment, so that it can be corrected.

If you face any issues feel free to contact me on WhatsApp
03129671316, 03085507292

If you want more improvement
Share feedback in the comment

INSTRUCTOR
MUHAMMAD BIN JAMEEL
BSC ENGG. CIVIL
 

Post a Comment

Previous Post Next Post