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 is an abstract class?

5 Answers   Siemens,


How will you print a list of all unique words from a string which may contain repeated words?

0 Answers   Adobe,


What is RTTI and why do you need it?

0 Answers   Amazon,


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

1 Answers  


What do you by Function Overloading in C++?

0 Answers   Akamai Technologies, Infogain,






Explain about Searching and sorting algorithms with complexities

0 Answers   Accenture,


How will you execute a stack using a priority queue? (Push and pop should be in O (1)).

0 Answers   Adobe,


Can we call a virtual function from a constructor?

1 Answers  


Question on Copy constructor.

0 Answers   Alter,


What is the 4 difference between delete[] and delete?

0 Answers   Alter,


CDPATH shell variable is in(c-shell)

0 Answers   Siemens,


Can we call C++ OOPS? and Why

0 Answers  


Categories