
C Pointers 17May2023

Quiz
•
Computers
•
University
•
Hard
A M Abirami
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
How do you access the content of the pointer variable p inside the C program?
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
# include <stdio.h>
void fun(int x)
{ x = 30; }
int main()
{
int y = 20;
fun(y);
printf("%d", y);
return 0;
}
20, as the function call uses Call by value
20, as the function call uses Call by reference
30, as the function call changes the value
Error in this code
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
# include <stdio.h>
void fun(int *ptr)
{ *ptr = 30; }
int main()
{
int y = 20;
fun(&y);
printf("%d", y);
return 0;
}
30, as the function call is by Call by reference (i.e. call by address)
30, as the function call is by Call by value
20, as the variable ptr has scope local to the function
Compile time error
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
int *ptr;
int x=5;
ptr = &x;
*ptr = 0;
printf("%d\n", x);
return 0;
}
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
#include <stdio.h>
int main() {
int *ptr;
int x=0;
ptr = &x;
*ptr = 10;
printf("%d\t %d\n", x, *ptr);
return 0;
}
10 10
10 0
0 10
10 Undefined
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
int *ptr;
int x=10;
ptr = &x;
printf("%d\t %d\n", x, *ptr);
*ptr += 5;
printf("%d\t %d\n", x, *ptr);
return 0;
}
10 10 15 15
10 10 10 15
10 10 15 Undefined
Error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
int *ptr;
int x=5, y;
ptr = &x;
y = x;
(*ptr)++;
printf("%d\t %d\n", x, y);
return 0;
}
6 5
5 6
Undefined 5
6 undefined
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Input And Output in C

Quiz
•
University
14 questions
FuncionesC

Quiz
•
University
20 questions
CCE-III Programming in C Language

Quiz
•
University
13 questions
C programming-1

Quiz
•
University
10 questions
Array in C

Quiz
•
University
10 questions
Arrays

Quiz
•
11th Grade - University
20 questions
C programming syntax quiz

Quiz
•
University
15 questions
C Language Quiz-1

Quiz
•
University - Professi...
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University