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

Tell us the size of a float variable.

0 Answers   Accenture,


Write a C++ Program to Find Sum and Average of n numbers using for loop.

1 Answers  


Write a C++ Program to Find Sum and Average of three numbers.

1 Answers  


Find the Factorial of a number using a program.

0 Answers   Accenture,


Difference between Call by pointer and by reference.

0 Answers   Adobe,






In C++ what is the meaning of data hiding?

0 Answers   Aricent,


How do you work around them?

0 Answers   Amazon,


What is the difference between Stack and Queue in C++?

0 Answers   Global Logic, iNautix,


Explain encapsulation in C++.

0 Answers   Verifone,


What is the difference between public, private, and protected inheritance?

0 Answers   Amazon,


What is Boyce Codd Normal form?

0 Answers   IBS,


Question on Copy constructor.

0 Answers   Alter,


Categories