I am new to C++ and have just installed my Borland Compiler.
Here is a very simple program I have written:
Code:
#include <iostream>
using std::cout;
using std::cin;
int main(){
cout<< "My lucky number is ";
int lnum;
lnum = 3;
lnum++;
return lnum;
return 0;
}
However, whenever I try to compile it, I get the following message:
Code:
myfirstprogram.cpp:
Warning W8066 myfirstprogram.cpp 10: Unreachable code in function main()
When I run the program, the "cout" is fine, and the output is "My lucky number is " as specified, but my variable "lnum" is not returned.
Thanks for reading, and please help me with my problem.