72. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int arr[] = {4, 5, 6, 7};
int *p = (arr + 1);
cout << *arr + 9;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int arr[] = {4, 5, 6, 7};
int *p = (arr + 1);
cout << *arr + 9;
return 0;
}
73. What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int &p;
int a = 5;
&p = a;
cout<<p;
return 0;
}
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int &p;
int a = 5;
&p = a;
cout<<p;
return 0;
}
74. Which of the following is incorrect?
75. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
char arr[20];
int i;
for(i = 0; i < 10; i++)
*(arr + i) = 65 + i;
*(arr + i) = '\0';
cout << arr;
return(0);
}
#include <iostream>
using namespace std;
int main()
{
char arr[20];
int i;
for(i = 0; i < 10; i++)
*(arr + i) = 65 + i;
*(arr + i) = '\0';
cout << arr;
return(0);
}
76. What are the parts of the literal constants?
77. What is the meaning of the following declaration?
int(*p[5])();
int(*p[5])();
78. What will happen in the following C++ code snippet?
int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
79. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
#define PI 3.14159
int main ()
{
float r = 2;
float circle;
circle = 2 * PI * r;
cout << circle;
return 0;
}
#include <iostream>
using namespace std;
#define PI 3.14159
int main ()
{
float r = 2;
float circle;
circle = 2 * PI * r;
cout << circle;
return 0;
}