Starting with C language - working online
There are many freely accessible sites on the internet, where you can write, compile and run C programs. Here I recommend two sites. Their advantage is that they also use gcc compiler, which you have at your disposal on school computers (under linux):
-
on-line C compiler
Tutorial
On the home page there are two windows. In the upper black window there is colored source text of a template program in C which you can arbitrarily edit. There are different buttons above: you can manage with the green button Run only, which compiles and runs the program.
After running the program, a "terminal" with header Input appears in the bottom window, which you can use for input data and where the results will be printed. If there is any syntax error in the program, another window named Stderr with information about the errors would appear.
-
www.tutorialspoint.com/compile_c_online.php
Tutorial
In the introductory window of the site you can see two windows: the blue window on the left - this is the working one - with buttons Execute and Embed and bookmarks main.c and Stdin above. Active bookmark is main.c. The white window Result on the right will be used for printing outputs of your program.
Bookmark main.c opens a blue window with highlighted simplest C program, which can be edited.
Bookmark Stdin opens a white window (on the left), where you can prepare input data for your program (you cannot use the keyboard for input data to a running program).
Button Execute runs your program program. The result is printed in the right window, where you can see also a gcc command, which has been used.
Adding the math library: use the menu in the upper right corner, choose Project/Compile options. A dialog window appears with the gcc command, which can be edited. To add math library, add the option -lm at the end of the gcc command and then use Update button, then close the window by Close button.