My courses What is the output of the following code cout<

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 18SA
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
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning