Answer to Question #276135 in C++ for ghjk

Question #276135

Ask user enter number 0-9 and make value of that index

null of above array


1
Expert's answer
2021-12-06T19:23:43-0500
#include<iostream>
using namespace std;
int main(){
	int arr[10] = {1,2,34,56,7,8,9,10,11};
	cout<<"Enter a value between 0 and 9:\n";
	int n;
	cin>>n;
	arr[n] = 0;
	for(int i=0; i<9; i++){
		cout<<arr[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