Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

1) c)object

2) b)<<
3) a)iostream
4) d) Bjarne Stroustrup
5) d) both // comment or /* comment */
6) c) C++ supports both procedural and object oriented programming language
7) d) int array[10]
What will be the output of the following C++ code?

#include <iostream>
using namespace std;
int main()
{
int a = 9;
int & aref = a;
a++;
cout << "The value of a is " << aref;
return 0;
}
17:56
IYAKUTTI
1)
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
int &q = 5;
cout<<q;
return 0;
}

2)
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
int &p;
int a = 5;
&p = a;
cout<<p;
return 0;
}

3)
What will be the output of the following C++ code?

#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;


int main()
{
int a = 5;
int *p = &a;
int &q = a;
cout<<*p<<endl;
cout<<*q<<endl;
return 0;
}
What will be the output of the following C++ code?

#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
int a = 5;
int &q = a;
cout<<&a<<endl;
cout<<&q<<endl;
return 0;
}
17:58
IYAKUTTI
What will be the output of the following C++ code?

#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
int a = 5;
int *p = &a;
int *(&q) = p;
cout<<q;
return 0;
}
18:00
IYAKUTTI
Which of the following statement is correct about the program given below?

#include<iostream.h>
int main()
{
int x = 80;
int y& = x;
x++;
cout << x << " " << --y;
return 0;
}
18:01
IYAKUTTI
Which of the following statement is correct about the program given below?

#include<iostream.h>
int main()
{
int x = 10;
int &y = x;
x = 25;
y = 50;
cout<< x << " " << --y;
return 0;
}
Which of the following statement is correct about the program given below?

#include<iostream.h>
int main()
{
int x = 0;
int &y = x; y = 5;
while(x <= 5)
{
cout<< y++ << " ";
x++;
}
cout<< x;
return 0;
}
18:02
IYAKUTTI
Which of the following statement is correct about the program given below?

#include<iostream.h>
int main()
{
int m = 2, n = 6;
int &x = m;
int &y = n;
m = x++;
x = m++;
n = y++;
y = n++;
cout<< m << " " << n;
return 0;
}

You might also like