In a C Program if
int a = 5;
Int *ptr = &a;
then the printf statement with
&a, a, *ptr , ptr
C - Pointers
Quiz
•
Computers
•
University
•
Hard
Vidhu Priya
Used 1K+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
6.
MULTIPLE CHOICE QUESTION
1 min • 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
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Is the NULL pointer same as an uninitialised pointer?
Yes
No
10 questions
Arrays in C (II yr 02.07.2020)
Quiz
•
University
12 questions
C Practice Test 1
Quiz
•
University
10 questions
pointers and structures
Quiz
•
University
15 questions
uNIT 11_14
Quiz
•
University
13 questions
DS UNIT-2 TEST-2
Quiz
•
University
10 questions
C Program Array and strings
Quiz
•
University
15 questions
Coding and Debugging
Quiz
•
University
10 questions
FLASH
Quiz
•
University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade