0% found this document useful (0 votes)
38 views2 pages

Quiz 1

The document presents a quiz on C++ syntax, including questions about for loops and array declarations. It asks for the output of specific code snippets and the correct way to declare one-dimensional and two-dimensional arrays. Additionally, it inquires about the values of certain elements in the arrays based on provided tables.

Uploaded by

Jhay El Gamba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Quiz 1

The document presents a quiz on C++ syntax, including questions about for loops and array declarations. It asks for the output of specific code snippets and the correct way to declare one-dimensional and two-dimensional arrays. Additionally, it inquires about the values of certain elements in the arrays based on provided tables.

Uploaded by

Jhay El Gamba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Quiz 1

What will be the output for the following C++ syntax?


1. int i=0;
for(int i=0;i<5;i++){
cout<<i<<””;
}

2. int i=0;
for(int i=0;i<3;i++){
for(int j=0;j<2;j++){

cout<<i<<j<<””;
}
1 2 3 4 5 6 7

Given the table above, Answer the following:

1. The correct declaration of an array in C++ is int arr[?];

2. What will be the result of the following C++ syntax? cout<<arr[0];

3. What will be the result of the following C++ syntax? cout<<arr[4];

1 2 3 4
5 6 7 8

Given the table above, Answer the following:

1. The correct declaration of an array in C++ is int arr[?][?];

2. What will be the value of arr[0][2]?

3. What will be the value of arr[1][3]?

You might also like