Score:-3

I can't run C++ code

in flag

I Can't Run Program Error message :

enter image description here

Here's the code:

#include <iostream>  
using namespace std;  
int main() 
{  
  cout << "C++";  
  return 0;  
}  
Score:4
us flag

First install the compilers if you already have not.

sudo apt install build-essential

Compile the program with g++ /path/to/filename.cpp -o /path/to/output (note that gcc may not work with programs written in C++. You would need g++).

Then run the program with /path/to/output.


Your code worked for me. I saved your code in the file new.cpp, and compiled it to an executable named output.

[archisman@home-pc ~]$ g++ new.cpp -o output
[archisman@home-pc ~]$ ./output 
C++
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.