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 bool in C++
What is the operator in c++?
How does class accomplish data hiding in c++?
Can a new be used in place of old mallocq? If yes, why?
What is the identity function in c++? How is it useful?
write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;
Why do we use class?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
How should runtime errors be handled in c++?
Which software is best for c++ programming?
What is main function in c++ with example?
Explain stack & heap objects?
What does the nocreate and noreplace flag ensure when they are used for opening a file?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What are disadvantages of pointers?