Problem Statement - Error identification
Identify errors in the following program. assume that appropriate header files are included.
int main()
{
x=1;
for(int j=10; j>5; j--)
cout>>x;
return 0;
}
Solution
x=1; //Error 1
This should be
int x=1; //int data type declaration is missing.
cout>>x; //Error 2
cout<<x; //incorrect operator has been used. It should stream extraction operator.
CSKC| Created: 2-Dec-2018 | Updated: 2-Dec-2018|
Post Views:
799