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

When would you choose to return an error code rather than throw an exception?

525


What is c++ and its features?

564


Briefly explain various access specifiers in C++.

552


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

600


What does std mean in c++?

572






What are two types of polymorphism?

600


How can you force the compiler to not generate them?

556


What is srand c++?

562


Give 10 points of differences between C & C++.

610


What is class in oop with example?

606


What is the default width for ouputting a long integer using the insertion operator?

676


Can a program run without main?

615


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3419


What are the differences between new and malloc?

621


How can I improve my c++ skills?

548