Observe the following C++ code and …
CBSE, JEE, NEET, CUET
Question Bank, Mock Tests, Exam Papers
NCERT Solutions, Sample Papers, Notes, Videos
Observe the following C++ code and find the possible output(s) from
the options (i) to (iv) following it. Also, write the minimum and
maximum values that can possibly be assigned to the variable End. 2
Note :
Assume all the required header files are already being included in
the code.
The function random(N) generates any possible integer between
0 and N-1 (both values included).
void main()
{
randomize();
int A[]={10,20,30,40,50,60,70,80};
int Start = random(2) + 1;
int End = Start + random(4);
for(int I=Start; I<=End, I++)
cout<<A[I]<<"$";
}
(i) 10$20$30$ (ii) 20$30$40$50$60$
(iii) 30$40$50$60$ (iv) 40$50$60$70$
Posted by Raj Komal 5 years, 9 months ago
- 1 answers
Related Questions
Posted by Syedali Fathima 1 year, 3 months ago
- 1 answers
Posted by Hanni Pham 1 year, 1 month ago
- 0 answers
Posted by Kandeepan Jothivel 1 year, 4 months ago
- 2 answers
Posted by Prawar Narang 1 year, 3 months ago
- 1 answers
Posted by Hanni Pham 1 year, 1 month ago
- 1 answers
Posted by Priya Shukla 1 year, 3 months ago
- 1 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app
Ashish Sharma 5 years, 9 months ago
0Thank You