Q. Find the output of the following program.
Code:main(){
char ch[] = “Interviewbit Scaler”;
int l = strlen(ch);
cout << l << endl;
}
Dear candidates you will find MCQ questions of C++ here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
main(){
char ch[] = “Interviewbit Scaler”;
int l = strlen(ch);
cout << l << endl;
}
main(){
int i = (1, 2, 3);
cout << i << endl;
}
string* p, q;
int num = 23; Statement (i): int *ptr = &(num + 2); Statement (ii): int *ptr2 = # Statement (iii): &&num = 50;
#include
using namespace std;
int main()
{
int p = 15;
if (p < 13) {
for (k = 0; k < 12; k++)
cout << k;
}
else {
cout << k;
}
return 0;
}
#include
using namespace std;
void Output()
{
static int p = 1;
int k;
for(k=p; k<=3; k++)
{
p++;
cout << p;
}
}
int main()
{
Output();
Output();
Output();
return 0;
}