Programming
October 20, 2023
Programming
October 20, 2023
Programming
October 20, 2023
Programming
October 20, 2023

Programming

Question 301
How many values can be held by an array A(–1,m;1,m) ?
A
m
B
m2
C
m(m+1)
D
m(m+2)
Question 301 Explanation: 
int A[n] means “n” elements and index starts from 0 to n-1.
→ Similarly, int A[n][n] means both column and rows has “n” elements and total elements are n*n nothing but n2 elements.
In the given example ,an array A(-1,m;1,m)
→ In which rows indexes are -1,0,1,2, and so on up to m then total rows are “m+2”.
→ columns consist of 1,2,3 and so on up to m then total elements in columns are “m”.
Total elements are (m+2)*m
Correct Answer: D
Question 301 Explanation: 
int A[n] means “n” elements and index starts from 0 to n-1.
→ Similarly, int A[n][n] means both column and rows has “n” elements and total elements are n*n nothing but n2 elements.
In the given example ,an array A(-1,m;1,m)
→ In which rows indexes are -1,0,1,2, and so on up to m then total rows are “m+2”.
→ columns consist of 1,2,3 and so on up to m then total elements in columns are “m”.
Total elements are (m+2)*m
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!