NCO- Cyber Olympiad (SOF) Class 11: Questions 595 - 598 of 599

Access detailed explanations (illustrated with images and videos) to 599 questions. Access all new questions we will add tracking exam-pattern and syllabus changes. Subscription can be renewed yearly absolutely FREE! View Sample Explanation or View Features.

Rs. 350.00 or

How to register?

Question number: 595

» Computer » Introduction of C++ Till Data Structure

Edit

Appeared in Year: 2014

MCQ▾

Question

What is the output of the given C++ code?

  1. #include<iostream.h>
  2. #include<conio.h>
  3. int disp();
  4. int p=45;
  5. void main()
  6. {
  7.     clrscr();
  8.     p=disp();
  9.     cout<<”  p=”<<p++;
  10.     p=disp();
  11.     cout<<”  p=”<<++p*2;
  12.     p=++p;
  13.     getch();
  14. }
  15. int disp()
  16. {
  17.     cout<<”  Displaying”;
  18.     return(p+2);
  19. }

Choices

Choice (4) Response

a.

Displaying

p = 47

Displaying

p = 102

b.

c.

Displayingp = 45

Displayingp = 102

d.

Question number: 596

» Computer » Introduction of C++ Till Data Structure

Edit
MCQ▾

Question

What is the output of the given C++ code?

  1. #include<iostream.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5.     clrscr();
  6.     int i=12j=16;
  7.     for (;i<j;i++)
  8.     {
  9.         if (i%2==1)
  10.         cout<<” ”<<i;
  11.     }
  12.     getch();
  13. }

Choices

Choice (4) Response

a.

12

14

b.

c.

1

3

d.

Question number: 597

» Computer » Introduction of C++ Till Data Structure

Edit
MCQ▾

Question

What will be the output of the following C++ program?

  1. void main()
  2. {
  3.     int a=10;
  4.     cout < < ++a < < ‘ ’;
  5.     cout < < a++ < < ‘ ’ < < endl;
  6. }

Choices

Choice (4) Response

a.

11 13

b.

c.

d.

11 12

Question number: 598

» Computer » Introduction of C++ Till Data Structure

Edit

Appeared in Year: 2014

MCQ▾

Question

What would be the output of given C++ program?

  1. #include<iostream.h>
  2. #include<conio.h>
  3. struct color
  4. {
  5.     int R,G,B;
  6. };
  7. void disp(color c)
  8. {
  9.     cout<<”Red”<<c.R<<”Green”<<c.G<<”Blue”<<c.B<<” ”;
  10. }
  11. void main()
  12. {
  13.     color c1={100200300}, c2c3;
  14.     clrscr();
  15.     c3=c1;
  16.     disp(c1);
  17.     c3.R++;
  18.     c3.G--;
  19.     c2=c3;
  20.     c2.B++;
  21.     disp(c2);
  22.     c1.B+=20;
  23.     c1=G-=10;
  24.     disp(c1);
  25.     disp(c3);
  26.     getch();
  27. }

Choices

Choice (4) Response

a.

b.

c.

d.