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 are the costs and benefits of using exceptions?

0 Answers   Amazon,


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

0 Answers  


What is a virtual function in C++?

0 Answers   C DAC,


What is bool in C++

0 Answers  


What is the difference between realloc() and free() in C++?

0 Answers   IBS, TCS,






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

0 Answers   Amazon,


Execute the qsort () in c/sort() in c++ library or your own custom sort which will sort any type of data on user defined criteria.

0 Answers   Adobe,


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

0 Answers  


What is wrong with this statement? std::auto_ptr ptr(new char[10]);

0 Answers   Amazon,


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

0 Answers  


To solve the 8 Queens problem, which algorithm is used?

0 Answers   Accenture,


What does it mean to declare a function or variable as static?

0 Answers   Amazon,


Categories