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 does the ios::ate argument do?
What is static modifier?
Can a program run without main function?
What is an overflow error?
Differentiate between an inspector and a mutator ?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
What is the 4 difference between delete[] and delete?
What is function declaration in c++ with example?
How a pointer differs from a reference?
What is the difference between member functions and static member functions?
Can class objects be passed as function arguments?
Explain queue. How it can be implemented?
#include
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
What is stream and its types in c++?