Which of the following is the correct way declaring an Array "Arr" which is an integer array having 20 element.?

quize

Quiz
•
Education
•
University
•
Easy
salma mohamed
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Array [] =Arr[20];
int Arr[20];
int[20] Arr;
int Arr= new [20];
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct way declaring an Array "MyArr" which is an integer array having 10 element.?
Array [] =MyArr[10];
int MyArr[10];
int[10] MyArr;
int MyArr= new [20];
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct way declaring an Array "MyArr" which is an double array having 10 element.?
Array [] =MyArr[10];
double[10] MyArr;
double MyArr[10];
int MyArr= new [10];
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statement Declare an array called ABC of 5 elements of type int and initialize all the elements to 100?
int ABC[5]= {100,100,100,100,100};
int ABC[ ]= {5,100};
int ABC[5]= {5,100};
int[5] ABC= {100,100,100,100,100};
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statement Declare an array called Y of 5 elements of type String and initialize the elements to
Ahmed, Khalifa, Mohammad, Sultan, Abdullah.
String Y[5]={"Ahmed","Khalifa","Mohammad", Sultan", "Abdullah"};
String Y[ ]={"Ahmed","Khalifa","Mohammad", Sultan", "Abdullah"};
int Y[5]={"Ahmed","Khalifa","Mohammad", Sultan", "Abdullah"};
String Y[5]={Ahmed,Khalifa,Mohammad, Sultan, Abdullah};
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statements correctly declare an Array Arr that have 5 elements and intialize it to zero using for loop?
int Arr[20];
For(i=0; i<20 ; ++i)
{
myArr[i]=0;
}
int Arr[5];
For(i=0; i<5 ; ++i)
{
myArr[i]=0;
}
int Arr[5];
For(i=0, i<5, ++i)
{
myArr[i]=0;
}
int Arr[5];
For(i=0; i<20 ; ++i)
{
myArr[i]=0;
}
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statements correctly declare an Array Arr that have 15 elements and intialize it such that each element is multiple of 2 using for loop?
int Arr[15];
For(i=0; i<15 ; ++i)
{
myArr[i]=i*2;
}
int Arr[5];
For(i=0; i<5 ; ++i)
{
myArr[i]=0*2;
}
int Arr[5];
For(i=0; i<5 ; ++i)
{
myArr[i]=0;
}
int Arr[5];
For(i=0,i<5 , ++i)
{
myArr[i]=0;
}
Create a free account and access millions of resources
Similar Resources on Quizizz
11 questions
OOAD Quiz 4

Quiz
•
University
10 questions
Moringa JavaScript Arrays

Quiz
•
5th Grade - Professio...
10 questions
C program

Quiz
•
University
11 questions
Python - Data Types

Quiz
•
12th Grade - University
12 questions
DS Quizz

Quiz
•
University
10 questions
PRUEBA DE JAVA MASTERY

Quiz
•
University
7 questions
PRF192x_2.1_Lesson 4

Quiz
•
University
12 questions
Квіз з програмування: Вказівники та динамічна пам'ять

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade