For this, you will need the Code Blocks Compiler.
Download Code Blocks Setup From Here
// You can also use some other compilers instead of Code Blocks
Start Code Blocks and create a new project, select Files and C/C++ Source File from the wizard.
/*This Program has been created by http://www.quvi.weebly.com- Author: Mehbubul Hasan AL- Quvi, All rights reserved to Red Cross, 2012 - IT and Software Development Team,
Date created and built on: 31 December, 2012.
Sample Program to get the square root of the given number in C.*/
#include <math.h>
#include <stdio.h>
int main(void)
{
double x, result;
printf ("Enter a number: ");
scanf ("%lf", x);
result = sqrt(x);
printf("\nThe square root of %lf is %lfn", x, result);
return 0;
}
/*Sample created by http://quvi.weebly.com*/
Now, go to the Build Menu and click on Compile Current File, you'll find no error or warnings. Now, again go to Build Menu and click on Run. The program will execute and will work fine. You'll be prompted, "Enter a number: "
Now, if you enter a number such as 4, the program will show, "The square root of 4 is 2"
You can also test this program online here
If you find any error or troubles, please let me know them through your comments.
HAPPY CODING!!!!