C++ Programming
Given int ages={7,12,9,6 };
What is the value of table [2][1]?
What is the value of table [2][1]?
int length;
string s1="programming is fun!";
length=s1.size();
cout<<length<<endl;
Int scores[]={83,62,77,97};
int numbers[]={99,87,66,55,101};
for(int i=1; i<4; i++)
{
cout<<setw(5)<<numbers[i];
}
87 66 55 b. 99 87 66 55 c. 87 66 55 101 d. 66 55 101
Ans1) Correct Option - (d) A hex value
Explaination :- Array name always stores the address of the first block.
Ans2) Correct Option - (d) A space
Explanation :- There is no character at that postion
Ans3) Correct Option - (c) the letter
Explanation :- Letter t is present at index 6
Ans4 Correct Option - (d) 1
Explanation :- Number 1 is present at table[2][1]
Ans5 Correct Option - (b) 19
Explanation :- The size of the string is 19
Ans6 Correct Option -(d) int numbers[100]
Explanation :- The syntax of varibale declaration is data_type variable_name;
Ans7 Correct Option - (c) Rows, columns
Explanation :- Two dimensional array consists of rows and columns.
Ans8 Correct Option - (b) int score[10];
Explanation :- Syntax of array declaration in C++ is data_type array_name[size]
Ans9 Correct Option - (c) scores[2]
Explanation :- Number 77 is stored at index 2
Ans10 Correct Option - (b) for loop
Explanation :- Usually for loops are being used for arrays
Ans11 Correct Option - (a) 87 66 55
Get Answers For Free
Most questions answered within 1 hours.