What will be the output of the following C++ program? # include <iostream>…

PYQ DSSSB 2018

What will be the output of the following C++ program?
# include <iostream>
using namespace std;
int main(){
char array[10];
int i;
for(i = 0; i < 5; i++)
*(array + i) = 65 + i;
*(array + i) = '\0';
cout << array;
return(0);
}

  1. A.

    ABCDE\0

  2. B.

    ABCDE

  3. C.

    BCDEF

  4. D.

    CDEFG

Attempted by 790 students.

Sign up free to check your answer

Sign up free

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…