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 are the benefits of interface?
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
Can a program run without main?
Show the declaration for a pointer to function returning long and taking an integer parameter.
What are the two types of comments?
Can java be faster than c++?
How java is different from c and c++?
Explain the uses oof nested class?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
Is c++ fully object oriented?
Can you write a function similar to printf()?
Describe private, protected and public?
In C++ what do you mean by Inheritance?
Why is c++ still used?
Why is main an int?