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";
}

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest c++ version?

813


What do you mean by overloading?

786


Is it possible to provide special behavior for one instance of a template but not for other instances?

826


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

3095


What is static variable and difference between(const char *p,char const *p,const char* const p).

750


How do you differentiate between overloading the prefix and postfix increments?

796


What is RTTI and why do you need it?

783


Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.

2755


Explain the pure virtual functions?

835


What are stacks? Give an example where they are useful.

770


What is pair in c++?

800


Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

826


Is java based off c++?

713


Write about the various sections of the executable image?

749


Const char *p , char const *p What is the difference between the above two?

912