What will be the output of the following C++ code? #include <stdio.h> ...
View QuestionWhich of the following gives the memory address of the first element in array?
a) array[0]; b) array[1]; c) array(2); d) array; Answer: d Explanation: To get the address of ith index ...
View QuestionWhich of the following accesses the seventh element stored in array?
a) array[6]; b) array[7]; c) array(7); d) array; Answer: a Explanation: The array location starts from zero, ...
View QuestionWhat is the correct definition of an array?
a) An array is a series of elements of the same type in contiguous memory locations b) An ...
View QuestionWhat is the index number of the last element of an array with 9 elements?
a) 9 b) 8 c) 0 d) Programmer-defined Answer: b Explanation: Because the first element always starts ...
View QuestionWhich of the following correctly declares an array?
a) int array[10]; b) int array; c) array{10}; d) array array[10]; Answer: a Explanation: Because array variable and values ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
char *ptr;
char Str[] = “abcdefg”;
ptr = Str;
ptr += 5;
cout << ptr;
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View Question
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);
}
What will be the output of the following C++ code? #include <iostream> ...
View QuestionThe correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is ____________
a) int **fun(float**, char**) b) int *fun(float*, char*) c) int **fun(float*, char**) d) int ***fun(*float, **char)
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int a = 5, b = 10, c = 15;
int *arr[ ] = {&a, &b, &c};
cout << arr[1];
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View Question