What will be the output of the following C++ program?
#include
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
ABCDE\0
2
ABCDE
3
CDEFG
4
BCDEF
What will be the output of the following C++ program?
#include
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;
}