Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a html for a problem, but when I open it with Chrome it doesn't show what's after cout.

What I have tried:

HTML
<!DOCTYPE html>
<html>
<body>


C++
int n,x,c,d;
int main ()
{cin>>n;
d=n%10;
while (n>10)
  {c=n%10;
   n=n/10;
  }
x=10*c+d;
if (x%2==0)
  cout<<x;
else 
  cout<<2*x;
return 0;
}


HTML
</body>
</html>
Posted
Updated 30-May-16 6:18am
v2

1 solution

If you want the html page to display some C code, you need to encode special chars.
Replace each < by &lt;

[CP changed my first answer]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900