IDE Commands: For Compiling and Executing C Program
IDE Commands
ØProgram written in C language can be run using Command Prompt, we can run using MS-DOS, Nowdays every windows operating system having inbuilt Command Prompt.
Ø We are going to use following tools for running our C program:
1.Window’s Command Prompt and
2.Turbo C/C++ (TC) Compiler.
Ø In order to run C program we must save or copy C program inside bin folder of TC software having path (Eg. C:/TC/bin/Hello.c) otherwise we are not able to run C program.
ØYou can create your own directory or folder using following commands.
C:\Users\sudam>D:
D:\>cd My Programs
D:\My Programs
Ø In above example cd is change directory command as well as change drive command. My Programs is my current changed directory which is created on (D:\ ) drive and it contains my all C Programs.
ØSuppose we have saved hello.c program inside “My Programs” folder or directory.
Ø Then we can use following command to compile hello.c
D:\My Programs>tcc hello.c
Ø After compilation its time to run c program,you just type program name and hit enter,you will get output on the console window.
D:\C Programs~1>hello
Hello World
Note::In case of Linux operating system for
compiling and running program use following steps:
1.For opening "geditor" go to Terminal type
command ->
$ gedit hello.c
2.Type your source program using "geditor" and
save as "hello.c "
3.For compiling use command as->
$ gcc hello.c -o hello
4.For running use command as->
$ ./a.out
5.Then give input to get output.
Nice article
ReplyDeleteKeep it up
ReplyDelete