Arrays in C (II yr 02.07.2020)
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
PRADHEEBA U
Used 37+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
int main()
{
int arr[5];
// Assume base address of arr is 2000 and size of integer is 32 bit
printf("%u %u", arr + 1, &arr + 1);
return 0;
}
What is the o/p of the program?
2004 2020
2004 2004
2004 Garbage value
The program fails to compile because Address-of operator cannot be used with array name
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h>
void fun(int **p);
int main()
{
int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 8, 7, 8, 9, 0};
int *ptr;
ptr = &a[0][0];
fun(&ptr);
return 0;
}
void fun(int **p)
{
printf("%d\n", **p);
}
What is the o/p of the program?
4
3
2
1
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statements mentioning the name of the array begins DOES NOT yield the base address?
1:When array name is used with the sizeof operator.
2:When array name is operand of the & operator.
3:When array name is passed to scanf() function.
4:When array name is passed to printf() function.
1
1,2
2
2,4
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statements are correct about an array?
1:The array int num[26]; can store 26 elements.
2:The expression num[1] designates the very first element in the array.
3:It is necessary to initialize the array at the time of declaration.
4:The declaration num[SIZE] is allowed if SIZE is a macro.
1
1,4
2,4
2,3
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
printf("%p\t%p", p, a);
}
In Output,
Same address is printed
Different address is printed
Compile time error
Nothing
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
void foo( int[] );
int main()
{ int ary[4] = {1, 2, 3, 4};
foo(ary);
printf("%d ", ary[0]);
}
void foo(int p[4])
{
int i = 10;
p = &i;
printf("%d ", p[0]);
}
Output of the Program?
10 10
Compile time error
10 1
Undefined behaviour
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?
foo[6];
foo[7];
foo(7);
foo;
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
Algorithm analysis: divide & conquer theory
Quiz
•
University
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
10 questions
Programacion Orientada a Objetos
Quiz
•
12th Grade - University
15 questions
Firewall and Network Security
Quiz
•
University
10 questions
Information systems concepts
Quiz
•
University
13 questions
L1 - Computer Networks
Quiz
•
University
15 questions
DBC CHAPTER 3 - REVISION
Quiz
•
University
15 questions
4.6.4 Logic Gates
Quiz
•
10th Grade - Professi...
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
