Write a program in C++ to create an array of 5 elements and print 2nd and 4th element.
i want the program
Answers
Answer:
code:
#include <iostream>
#include <iostream>using namespace std;
#include <iostream>using namespace std;int main()
#include <iostream>using namespace std;int main(){
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements int numbers[5] = {1, 2, 3, 4, 5};
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements int numbers[5] = {1, 2, 3, 4, 5}; // Print the second and fourth elements
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements int numbers[5] = {1, 2, 3, 4, 5}; // Print the second and fourth elements cout << "The second element is: " << numbers[1] << endl;
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements int numbers[5] = {1, 2, 3, 4, 5}; // Print the second and fourth elements cout << "The second element is: " << numbers[1] << endl; cout << "The fourth element is: " << numbers[3] << endl;
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements int numbers[5] = {1, 2, 3, 4, 5}; // Print the second and fourth elements cout << "The second element is: " << numbers[1] << endl; cout << "The fourth element is: " << numbers[3] << endl; return 0;
#include <iostream>using namespace std;int main(){ // Create an array of 5 elements int numbers[5] = {1, 2, 3, 4, 5}; // Print the second and fourth elements cout << "The second element is: " << numbers[1] << endl; cout << "The fourth element is: " << numbers[3] << endl; return 0;}
Answer:
Mark the above as brainlist