Write the program segment for the following questions. ALL question are not
related.
1. set the array mark with size 10 using input statement
2. set the first three elements of array itemX using input statement
3. set the third element until the sixth element of array itemX using input statement
4. set the array array with size 5 with the following data: 3, 5, 7, 9, and 11
a) int n;
cout<<"Enter the mark\n";
cin>>n;
int arr[n];
b) int i;
int itemX[10];
for(i=0; i<2; i++){
cin>>itemX[i];
}
c)
int itemX[10];
for(i=2; i<5; i++){
cin>>itemX[i];
}
d)
int arr[5] = { 3, 5, 7, 9,11};
Comments
Leave a comment