Answer to Question #261279 in C++ for hii

Question #261279

Complete the declaration and initialization of the array variable with datatype character, char array[ ]=???;. Initialized the first index with A, the second index with T, the third index E, the fourth index N, the fifth index as E, and the sixth index as O.


Your answer's format should be a complete declaration at the same time initialization:

format: datatype array_name[ ]=???;



Answer:

1
Expert's answer
2021-11-08T17:37:31-0500
#include<iostream>
using namespace std;
int main(){
	char name[6];
	name[0] = 'A';
	name[1] = 'T';
	name[2] = 'E';
	name[3] = 'N';
	name[4] = 'E';
	name[5] = 'O';
	
	for(int i=0; i<6; i++){
		cout<<name[i]<<"  ";
	}
	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS