Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to write and run code in command prompt

+3 votes
asked Feb 16 by Enugala Manideepu Reddy (150 points) 1 flag

3 Answers

0 votes
answered Feb 17 by Peter Minarik (22,320 points)

What exactly do you mean by "command prompt"?

Do you refer to Windows Command Prompt?

Have a look at these:

Or Linux shell, e.g. Bash?

You can look at these:

Something else? Please, specify.

0 votes
answered Feb 28 by Tech Treat (140 points)
First you have to save your code in a document, Then go to command prompt type the code cd (folder name) next you have type your compiler code along with your document name. Then use ./a.out code

For example,

I created a language folder. In that, I created program.c document which has code in it, Now I have to go to command prompt and type cd language code.

if I am using gcc compiler, I have to enter gcc program.c

if there is no errors, It get compiled. Then i have to enter ./a.out code to execute the program
0 votes
answered Mar 8 by Asrith Potnuru (140 points)

for output you need to type a keyword ./a.out

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.