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 does stack look in function calls? When does stack overflow? What can you do to remedy it?

0 Answers   Adobe,


what is friend function in C++?

0 Answers   TCS,


How does free know the size of memory to be deleted

0 Answers  


Write a C++ Program to find Square Root of a number using sqrt() function.

1 Answers  


Write a C++ Program to Reverse a Number using while loop.

1 Answers  


What is RTTI and why do you need it?

0 Answers   Amazon,


Question on Copy constructor.

0 Answers   Alter,


What is an algorithm (in terms of the STL/C++ standard library)?

0 Answers   Amazon,


Write a C++ Program to find Addition of Two Numbers.

1 Answers  


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

0 Answers   Adobe,


C++ Public access specifier instead of Private – What is bad ?

0 Answers  


Categories