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
What is code reusability in c++?
How do you work around them?
What is the difference between malloc, calloc and realloc?
Which should be more useful: the protected and public virtuals?
What c++ library is string in?
What do you mean by overhead in c++?
Which operator cannot overload?
What is c++ code?
When is dynamic checking necessary?
What is the difference between a declaration and a definition?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
How the keyword struct is different from the keyword class in c++?
When do we use copy constructors?
What is a memory leak c++?
In a function declaration what does extern means?