Finding errors – Programming basics – CSKC
Sign In

Search

Solved Problem! #CPP#3159    siteicon   siteicon  

Problem Statement - Finding errors – Programming basics

Find the errors in the following code and explain.

TC++ #3159

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP

Solution


#include <iostream> //OK
using namespace std; //OK
float main()                 //NOT-OK, main must return int type. in old compilers void is also allowed
{
cout<< “Sun rises”>>” in the east.”;
NOT-OK, >> operator can not be used in cout chain. We can only use stream insertion operator << while writing the cout chain.
return 0;  //OK
}


Share

Created: 29-Jan-2018 19:21 | Updated: 22-Mar-2026 20:22|