
C Pointers 17May2023
Authored by A M Abirami
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
C Programming Quiz-5
Quiz
•
University
20 questions
Thiết kế trình chiếu PowerPoint (41-60)
Quiz
•
University
12 questions
ロジックテスト (Đề kiểm tra năng lực IT)
Quiz
•
University
20 questions
Fotogrametri dan Penginderaan Jauh
Quiz
•
University
15 questions
СОР_8 класс_раздел 1
Quiz
•
10th Grade - University
17 questions
Algorytmy 8
Quiz
•
1st Grade - University
15 questions
Computer and Other Human Inventions
Quiz
•
University
10 questions
Session 2
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade