In Windows machine
Follow these following steps-
Step 1:
go to this link: https://filehippo.com/download_codeblocks/
Step 2:
Download the code-blocks software
Step 3:
Install it
step 4:
If you run it the first time it will ask you to set gcc default compiler.
Just Click "OK" Button
Just Click "OK" Button
Step 5:
create a new file
step 6:
save it as any name you want but with .c extension
example : first.c
step 7:
type this code and save it.
#include<stdio.h>
#include<stdio.h>
int main()
{
printf("Welcome\n");
return 0;
}
step 8:
Run the Program
by pressing F9
or
clicking "Build and Run" button on the code-blocks window
Now if the code runs without any error then you are all set 😎
In Linux machine
Step 1:
Open terminal
Use the mouse to do it
or
Ctrl+alt+T shortcut to open it
Ctrl+alt+T shortcut to open it
Step 2:
type the command:
gedit <name>.c&
here, the name can be anything you want but use the reasonable one
Example: gedit first.c&
Step 3:
type this code and save it.
#include<stdio.h>
int main()
{
printf("Welcome\n");
return 0;
}
Step 4:
Compile :
gcc <name>.c -o <name>
Run:
./<name>
For my case this will be:
compile : gcc first.c -o first
run: ./first
Now if the code runs without any error then you are all set 😎
Happy Coding
See you in the next tutorial
Next Post:
https://coderavens.blogspot.com/2018/05/c-programming-3-bits-bytes.html
Comments
Post a Comment