Hi all,
Today i will explain how to run cpp or c++ programs in Ubuntu easily.
we are going to use an IDE called geany to runcpp programms.
Step 1 :first of all open terminal.as below screen shot.
step 2 : type the following code in terminal.
it asks to do you want to download type simply
step 3 : Now you finally open geany. as shown in the below screen shot.
step 4: open geany. Look as follows
Step 5: now type your code in the editor as follows.
Here the first two lines should be added to the program.
Here is a sample hello world programm.
step 6 : Now we have to save the program by pressing
As follows
Thanks for reading my blog..
Today i will explain how to run cpp or c++ programs in Ubuntu easily.
we are going to use an IDE called geany to runcpp programms.
Step 1 :first of all open terminal.as below screen shot.
step 2 : type the following code in terminal.
sudo apt-get update
sudo apt-get install geany
it asks to do you want to download type simply
y
step 3 : Now you finally open geany. as shown in the below screen shot.
step 4: open geany. Look as follows
Step 5: now type your code in the editor as follows.
#include <iostream>
using namespace std;
Here is a sample hello world programm.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World! madhu \n";
return 0;
}
step 6 : Now we have to save the program by pressing
ctr+s
As follows
Choose the directory where you want to save the cpp programm.
And type the file name with the extension .cpp.
click on save.
Step 7 : Now we have to compile the programm and run it.
- After saving the cpp program press F8 button to compile it. OR you can go to build menu and click on compile.
- check whether there is any errors in compile window. If it shows compilation finished successfully the there are no errors in your code .
- Now Build out put file by pressing F9 or build option in build menu.
- Finally run it by pressing F5 or by run option in build menu.
- the output will be shown in terminal as follows.
come again to learn another interesting topics......
No comments:
Post a Comment