60 347
Assignments Done
98%
Successfully Done
In April 2018

Answer to Question #3090 in C++ for wizzy

Question #3090
Given a string of 5 names( jonhson, mabel ,anthony, kwame and josef) write the code for the display of :
a) the third element of the array
b) the third element of the second
Expert's answer
#include <iostream.h>

void main()
{
char names[5][10]={"jonhson", "mabel", "anthony", "kwame", "josef"};
cout<<names[2]<<"\n"; //printing 3-rd element, third element has index 2
cout<<names[1][2]<<"\n"; //printing 3-rd element of the 2-nd
int i;
cin>>i; //delay
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions