C is a general-purpose programming language with features economy of expression, modern flow control and data structures, and a rich set of operators. The C language is designed to create small, fast programs, and It’s lower-level than most other languages; that means it creates code that’s a lot closer to what machines really understand.
C was originally designed for and implemented on the UNIX operating system on the DEC PDP-11, by Dennis Ritchie at AT & T’s Bell Laboratories of the USA in 1972.
C is most widely used computer language and used where speed, space, and portability are important. The operating system (Windows, iOS, Linux, Ubuntu, and Android), the C compiler, and essentially all UNIX applications programs have been written in C.
C has now become a widely used programming language for various reasons:
- Reliable, Portable and Extensible
- Easy to learn
- Structured language
- It produces efficient programs
- It can handle low-level activities
- Machine Independent
Why Use C?
- I believe that nobody can learn C++ or Java directly. This is because while learning these languages you have things like classes, objects, inheritance, polymorphism, templates, exception handling, references, etc. Learning these complicated concepts when you are not even comfortable with the basic language elements. Hence one should first learn all the language elements very thoroughly using C language before migrating to C++, C# or Java.
- Major parts of popular operating systems like Windows, UNIX, Linux is still written in C. This is because of even today when it comes to performance (speed of execution) nothing beats C.
- Mobile devices like cellular phones and palmtops are becoming increasingly popular. Also, common consumer devices like a microwave oven, washing machines, and digital cameras are getting smarter by the day. This smartness comes from a microprocessor, an operating system and a program embedded in this devices. These programs not only have to run fast but also have to work in the limited amount of memory. No wonder that such programs are written in C.
- Many popular gaming frameworks have been built using C language.
C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language. Some examples of the use of C might be:
- Operating Systems
- Language Compilers
- Text Editors
- Print Spoolers
- Network Drivers
- Modern Programs
- Language Interpreters
I hope that these are very convincing reasons why everyone should adopt C as the first and the very important step in your hunt for learning programming languages.
A Simple C Program
Below program is a very simple and basic program in C language. This program displays
Hello World! in the output window. all of the syntax and commands in C are case sensitive. Also, each statement should be ended with
semicolon (;) which is a statement terminator.
// printf() displays the string inside quotation
When you run and compiled above program, It will produce below output: