Examveda

What will be the output of the following C++ code?
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
    char str[5] = "ABC";
    cout << str[3];
    cout << str;
    return 0;
}

A. ABC

B. ABCD

C. AB

D. AC

Answer: Option A


Join The Discussion

Related Questions on Arrays and Strings in C plus plus