Functions
October 20, 2023Programming
October 20, 2023Programming
Question 301 |
How many values can be held by an array A(–1,m;1,m) ?
m | |
m2 | |
m(m+1) | |
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
→ 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
→ 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
Subscribe
Login
0 Comments