1D arrays Q2 - CSCI 152 C Quiz 2 9 March Spring 2011 Name 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSCI 152 C Quiz 2 ( 9 March ) Spring 2011 Name __________________________ 1. Given the following declarations: int list[12] = { 4, 9, 1, 7, 3, 6, 2, 11, 12, 8, 5, 10 }; int n = 3; Answer these questions, using the original values for each question: a) How many elements are there in list? _____________________________ b) What is the subscript (index) of the smallest element value in list? _____________________________ c) What is the value of list [n] ? _____________________________ d) What is the value of list [n] * 2 ? _____________________________ e) What is the value of list [n + 2] ? _____________________________ f) Write a statement which will assign to the last element a value which is twice the value of the third element. _____________________________ g) How many values are output by this loop: for (n = 0; n < 12; n = n + 2)...
View Full Document

This note was uploaded on 04/24/2011 for the course CSCI 1302 taught by Professor Harter during the Spring '11 term at Texas A&M University–Commerce.

Page1 / 3

1D arrays Q2 - CSCI 152 C Quiz 2 9 March Spring 2011 Name 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online