Question #276135

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

null of above array


Expert's answer

#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]<<" ";
	}
	
}
LATEST TUTORIALS
APPROVED BY CLIENTS