C programming language: To easily learn C language you must start making programs in it. As you may already know that to develop programs you need a text editor and a compiler to translate a source program into machine code which can be executed directly on a machine. Dev C++ IDE is a good choice, so if you are not having it installed on your computer then download Dev C++ compiler.
C programs list
Odd or Even
Add, subtract, multiply and divide
HCF and LCM
Decimal to binary conversion
nCr and nPr
Add n numbers
Find armstrong number
Generate armstrong number
Print floyd’s triangle
Print pascal triangle
Addition using pointers
Maximum element in array
Minimum element in array
Insert element in array
Delete element from array
Multiply two matrices
Sort a string
Merge two files
List files in a directory
Add complex numbers
Get IP address
Compiling and executing C programs
Now you have the tool to create programs, if you wish to look at some example codes then see C programming examples. Now I will explain to you how to compile and run your programs. You may be using a different compiler or operating system. I will explain to you how to use Dev C++, GCC and Turbo C compiler.
1. Create a new file (Ctrl+N).
2. Write the code.
3. Press Ctrl+F9 to compile the program. If there are any compile-time errors then fix them.
4. Press Ctrl+F10 to run the program.
Compiling and running C programs in GCC compiler
1. Save the code in a file say “hello.c” (quotes for clarity).
2. To compile open terminal and type “gcc hello.c”.
3. To execute type “./a.out”.
You can also specify the output file name as:
gcc hello.c -o hello.out
hello.out is the name of the output file.
Turbo C compiler:
1. Write your code to a file and save it.
2. Compile by pressing Alt + F9.
3. Execute by pressing Ctrl + F9.
4. For viewing output of the program, press (Alt + F5).