Identify the error in the following program.
include<iostream>
using namespace std;
void main()
{
int num[]={1,2,3,4,5,6};
num[1]==[1]num ? cout<<"Success" : cout<<"Error";
}



Identify the error in the following program. include<iostream> using namespace std; void ma..

Answer / hr

num [1] = [1] num?. You should write index number after array name but here index number is mention before array name in [1] num
So expression syntax error will be shown.
Correction : num[1] = num[1]? is the correct format.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

What's the value of the expression 5["abxdef"]?

0 Answers  


What is a virtual base class?

6 Answers   Fidelity, Siemens,


What do you by Function Overloading in C++?

0 Answers   Akamai Technologies, Infogain,


When must you use a constructor initializer list?

0 Answers   Amazon,


dynamic scoping is

0 Answers   Siemens,






How many times will this loop execute? Explain your answer.

0 Answers  


If class D is derived from a base class B

0 Answers  


Describe the different styles of function prototypes in C++.

0 Answers   Adobe,


What do you know about Volatile keyword in C++? Explain with an example code.

0 Answers   Adobe,


What is Advantage and Use of THIS pointer in C++ – Scenarios?

0 Answers  


write a program To generate the Fibonacci Series.

0 Answers   Accenture,


Can we use THIS Pointer in static function – Reason in C++?

0 Answers  


Categories