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
When would you choose to return an error code rather than throw an exception?
What is c++ and its features?
Briefly explain various access specifiers in C++.
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
What does std mean in c++?
What are two types of polymorphism?
How can you force the compiler to not generate them?
What is srand c++?
Give 10 points of differences between C & C++.
What is class in oop with example?
What is the default width for ouputting a long integer using the insertion operator?
Can a program run without main?
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
What are the differences between new and malloc?
How can I improve my c++ skills?