What is the output of this program? #include <iostream> using namespace std;…

SSC Scientific Assistant 2017

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);
}
  1. A.

    ABCDEFGHIJ

  2. B.

    AAAAAAAAAA

  3. C.

    JJJJJJJJ

  4. D.

    None of these

Attempted by 259 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…