Consider the following declaration: int beta (3]|31: What is stored in beta after the following a) b) What is the output after the following statements executes? int i, list(6): for (i = 0; i<6; i++) { list(i) =3+2*i: if (1%3==0) statements executes? int i. j: for ( in0; ic-2: i+) for ( ja0: j<=2: j++) betali]li] = 2* (i+j) % 4; list(i)=listli]+i; cout<

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
) Answer the following:
Consider the following declaration:
int beta [3||3]:
What is stored in beta after the following
b) What is the output after the following statements
executes?
int i, list(6):
for (i = 0; i< 6; i++)
{ listli) =3+2*i:
if (i%3==0)
a)
statements executes?
int i. j:
for ( im0; i<=2; i++)
for ( j=0; j<=2: j++)
betafilli] = 2* (i+j) % 4;
tistfi)=listli]+i:
cout<<setfill'@'}<<setw(4}<list[i];
e) Consider the following function:
int secret(int one)
d) What is the output of the statement?
listElement (list, 6);
when int list 6]={23,14,3.-6,36,85};
and the function listElement is:
int i;
int prod = 1;
for (i = 1; i<= 3; it)
prod = prod * one;
return prod;
void listElement (int x[ ], int Z)
int i;
for (i= 0; i < Z; i++)
{ xli)=x[Z-i-1]-pow(i.2.0):
cout<<xfi]<<" ";
}}
What is the output of the following C+ statements?
1- cout<<secret(5)<<endl;
2- cout<<2*secret(6)<<endl;
Transcribed Image Text:) Answer the following: Consider the following declaration: int beta [3||3]: What is stored in beta after the following b) What is the output after the following statements executes? int i, list(6): for (i = 0; i< 6; i++) { listli) =3+2*i: if (i%3==0) a) statements executes? int i. j: for ( im0; i<=2; i++) for ( j=0; j<=2: j++) betafilli] = 2* (i+j) % 4; tistfi)=listli]+i: cout<<setfill'@'}<<setw(4}<list[i]; e) Consider the following function: int secret(int one) d) What is the output of the statement? listElement (list, 6); when int list 6]={23,14,3.-6,36,85}; and the function listElement is: int i; int prod = 1; for (i = 1; i<= 3; it) prod = prod * one; return prod; void listElement (int x[ ], int Z) int i; for (i= 0; i < Z; i++) { xli)=x[Z-i-1]-pow(i.2.0): cout<<xfi]<<" "; }} What is the output of the following C+ statements? 1- cout<<secret(5)<<endl; 2- cout<<2*secret(6)<<endl;
Expert Solution
steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education