Questions On C++
Questions On C++
a)5
b)10
c)15
d) it will return some random number
8) The 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)
9) What is the output of this program?
#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);
}
a) ABCDEFGHIJ
b) AAAAAAAAAA
c) JJJJJJJJ
d) none of the mentioned
10) What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
char *ptr;
char Str[] = "abcdefg";
ptr = Str;
ptr += 5;
cout << ptr;
return 0;
}
a) fg
b) cdef
c) defg
d) abcd