My courses What is the output of the following code 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 quickly without a detailed solution
My courses
What is the output of the following code cout<<endl;
int size=9;
char
n[]={'t','h','e','a','a','u','p', 'c', 's'};
char temp;
int c=0;
while (n[c] != 'j')
C++;
C++;
for (int i=c; i<size; i++)
{ temp n[i];
}
n[i]n[i+2];
n[i+2]-temp:
for (int i=0; i<size; i++)
cout << n[i];
cout<<endl;
a. cspuaaeht
Ob. aaupthesc
c. sctheaaup
d. theaaupcs
hp
mod
Transcribed Image Text:My courses What is the output of the following code cout<<endl; int size=9; char n[]={'t','h','e','a','a','u','p', 'c', 's'}; char temp; int c=0; while (n[c] != 'j') C++; C++; for (int i=c; i<size; i++) { temp n[i]; } n[i]n[i+2]; n[i+2]-temp: for (int i=0; i<size; i++) cout << n[i]; cout<<endl; a. cspuaaeht Ob. aaupthesc c. sctheaaup d. theaaupcs hp mod
Not yet answered Marked out of 1.00
Rewrite the following code using for loop:
main()
{
int a=1;
while(a<5)
cout<<a++;
}
Select one:
O a. for(int a=1;a<=5; a++) cout<<a;
b. for(int a=1;a<=5;) cout<<++a;
O c. for(int a=1,<=5,a++) cout<<++a;
O d. for(int a=1,<=5,a++) cout<<a;
Clear my choice
Previous page
FEB 1
21
Transcribed Image Text:Not yet answered Marked out of 1.00 Rewrite the following code using for loop: main() { int a=1; while(a<5) cout<<a++; } Select one: O a. for(int a=1;a<=5; a++) cout<<a; b. for(int a=1;a<=5;) cout<<++a; O c. for(int a=1,<=5,a++) cout<<++a; O d. for(int a=1,<=5,a++) cout<<a; Clear my choice Previous page FEB 1 21
Expert Solution
steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
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