{ A destination to learn coding }

Learn C Programming

Before you start...

C is one of the most widely used programming language. It was designed by Dennis Ritchie and developed by Dennis Ritchie and Bell Labs. It first appeared in the year 1972.
C is a fast and portable programming language and is available on all platforms.
C is a highly efficient programming language.
The language is good for beginners to start with.

Letzcode provides a lot of code examples. Kindly run those programs on your compilers.
Don' just read the codes, understand them.

Uses of C programming

  1. Used for programming embedded systems and operating systems.
  2. Languages like Python, Perl and PHP are influenced by C.
  3. You can contribute to the large open source projects like Python and GO


Tools required for writing a C program

An IDE like Codeblocks (good for beginners), Visual Studio, Dev C++ etc.

OR

1. A text editor (like notepad, notepad++, sublime text)
2. A compiler (like GCC and Visual Studio)


What is an IDE?

IDE stands for Integrated Development Environment. It normally consists of source code editor, debuggers and build automation tools.


A basic example of C

#include<stdio.h>
int main()
{
    printf("Hello World");
}
			

Understanding the code

In the above example, a standard library is included. In C programming, we use a lot of pre-defined header files which are already present in the compiler.(they come along with the compilers)
stdio.h is a header file where functions like printf() and scanf() are defined.
printf() is used to print an output. Its function is defined in the stdio.h header file.
In C, code execution starts with the main() function. It is mandatory to use this function.


How to compile a C Program?

Compiling a C Program using IDE

  1. Save the program with .c extension.
  2. Compile the program. This will search for any bugs in the program and report you back.
  3. RUN the program after the compilation is successful.
On successful compilation of th code two files are created, .exe(executable file) and .obj(object code) file.
Object code contains set of instruction in the binary form which is read by the computer.
file_name.exe file is the executable file.

Also read: Compiled V/S Interpreted Languages
C Codes