Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Suppose int i = 5, which of the following can be used as an index for array double t[100]? i + 10 i +

1. Suppose int i = 5, which of the following can be used as an index for array double t[100]?

i + 10
i + 6.5
rand() % 100
rand() / 100
i

2. Analyze the following code: #include using namespace std; void reverse(const int list[], const int size, int newList[]) { for (int i = 0; i < size; i++) newList[i] = list[size - 1 - i]; } int main() { int list[] = {1, 2, 3, 4, 5}; int newList[5]; reverse(list, 5, newList); for (int i = 0; i < 5; i++) cout << newList[i] << " "; return 0; }

The program displays 1 2 3 4 6.
The program displays 1 2 3 4 5 and then raises an ArrayIndexOutOfBoundsException.
The program displays 5 4 3 2 1.
The program displays 5 4 3 2 1 and then raises an ArrayIndexOutOfBoundsException.

3. What will be displayed by the following code? char s2[7] = "Dallas"; char s1[14] = "Dallas"; strcat(s1, s2); cout << s1;

DallasDallas
D
Dallas
DD

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

Which months of this year 5 Mondays ?

Answered: 1 week ago

Question

Define Leap year?

Answered: 1 week ago

Question

Prepare a short profile of Lucy Clifford ?

Answered: 1 week ago

Question

Prepare a short profile of Rosa parks?

Answered: 1 week ago

Question

=+j Enabling a productive global workforce.

Answered: 1 week ago

Question

=+ Are you interested in creating or

Answered: 1 week ago

Question

=+working on a micro-multinational?

Answered: 1 week ago