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

Define an Abstract class in C++?

0 Answers  


What is the meaning of the following declaration: int *const *const *i?

0 Answers   Adobe,


Write a C++ Program to Display Number (Entered by the User).

1 Answers  


How to delete array of objects in C++? Proof by C++ code for proper deletion

0 Answers  


Discuss about iteration statements in C++ .

0 Answers   Agilent,






When must you use a constructor initializer list?

0 Answers   Amazon,


Explain the importance of method overloading in C++?

0 Answers   Akamai Technologies, Infogain,


What are "pure virtual" functions?

0 Answers   Adobe, Alter, iNautix,


What are the advantages/disadvantages of using #define?

0 Answers   Amazon,


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

0 Answers   Adobe,


What does it mean to take the address of a reference?

0 Answers   Amazon,


What is an abstract class in C++

0 Answers   SwanSoft Technologies,


Categories