
POINTERS

Quiz
•
Computers
•
University
•
Hard
Shilpa Madhavanavar
Used 14+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
A pointer is
A keyword used to create variables
A variable that stores address of an instruction
A variable that stores address of other variable
All of the above
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Comment on the following pointer declaration?
int *ptr, p;
ptr is a pointer to integer, p is not
ptr and p,both are pointers to integer
ptr is pointer to integer,p may or may not be
ptr and p both are not pointers to integers
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C code?
#include <stdio.h>
void m(int *p)
{
int i = 0;
for(i = 0;i < 5; i++)
printf("%d\t", p[i]);
}
void main()
{
int a[5] = {6, 5, 3};
m(&a);
}
0 0 0 0 0
6 5 3 0 0
Run time error
6 5 3 junk junk
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Can you combine the following two statements into one?
1. char *p;
2. p = (char*) malloc(100);
char p = *malloc(100);
char *p = (char) malloc(100);
char *p = (char*)malloc(100);
char p = (char )(malloc*)(100);
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
printf("%d%d%d\n", k, *p, **m);
}
5 5 5
5 5 junkvalue
5 junk junk
Run time error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code snippet.
#include <stdio.h>
void main()
{
char *p=NULL;
char *q=0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf(" q ");
else
printf(" nullq");
}
p,q
Depends on the compiler
x nullq where x can be p or nullp depending on the value of NULL
nullp nullq
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
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
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
C programozás - String és file kezelés

Quiz
•
University
9 questions
Программалау

Quiz
•
University
10 questions
NoeliaHidalgoMartin_curso

Quiz
•
University
12 questions
C Basics

Quiz
•
University
11 questions
Array

Quiz
•
University
12 questions
OS with C programming

Quiz
•
University
14 questions
Java Operators

Quiz
•
University
15 questions
EDA PARTE 2

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University