- C Programming Tutorial
- C - Home
- Basics of C
- C - Overview
- C - Features
- C - History
- C - Environment Setup
- C - Program Structure
- C - Hello World
- C - Compilation Process
- C - Comments
- C - Tokens
- C - Keywords
- C - Identifiers
- C - User Input
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Integer Promotions
- C - Type Conversion
- C - Type Casting
- C - Booleans
- Constants and Literals in C
- C - Constants
- C - Literals
- C - Escape sequences
- C - Format Specifiers
- Operators in C
- C - Operators
- C - Arithmetic Operators
- C - Relational Operators
- C - Logical Operators
- C - Bitwise Operators
- C - Assignment Operators
- C - Unary Operators
- C - Increment and Decrement Operators
- C - Ternary Operator
- C - sizeof Operator
- C - Operator Precedence
- C - Misc Operators
- Decision Making in C
- C - Decision Making
- C - if statement
- C - if...else statement
- C - nested if statements
- C - switch statement
- C - nested switch statements
- Loops in C
- C - Loops
- C - While loop
- C - For loop
- C - Do...while loop
- C - Nested loop
- C - Infinite loop
- C - Break Statement
- C - Continue Statement
- C - goto Statement
- Functions in C
- C - Functions
- C - Main Function
- C - Function call by Value
- C - Function call by reference
- C - Nested Functions
- C - Variadic Functions
- C - User-Defined Functions
- C - Callback Function
- C - Return Statement
- C - Recursion
- Scope Rules in C
- C - Scope Rules
- C - Static Variables
- C - Global Variables
- Arrays in C
- C - Arrays
- C - Properties of Array
- C - Multi-Dimensional Arrays
- C - Passing Arrays to Function
- C - Return Array from Function
- C - Variable Length Arrays
- Pointers in C
- C - Pointers
- C - Pointers and Arrays
- C - Applications of Pointers
- C - Pointer Arithmetics
- C - Array of Pointers
- C - Pointer to Pointer
- C - Passing Pointers to Functions
- C - Return Pointer from Functions
- C - Function Pointers
- C - Pointer to an Array
- C - Pointers to Structures
- C - Chain of Pointers
- C - Pointer vs Array
- C - Character Pointers and Functions
- C - NULL Pointer
- C - void Pointer
- C - Dangling Pointers
- C - Dereference Pointer
- C - Near, Far and Huge Pointers
- C - Initialization of Pointer Arrays
- C - Pointers vs. Multi-dimensional Arrays
- Strings in C
- C - Strings
- C - Array of Strings
- C - Special Characters
- C Structures and Unions
- C - Structures
- C - Structures and Functions
- C - Arrays of Structures
- C - Self-Referential Structures
- C - Lookup Tables
- C - Dot (.) Operator
- C - Enumeration (or enum)
- C - Structure Padding and Packing
- C - Nested Structures
- C - Anonymous Structure and Union
- C - Unions
- C - Bit Fields
- C - Typedef
- File Handling in C
- C - Input & Output
- C - File I/O (File Handling)
- C Preprocessors
- C - Preprocessors
- C - Pragmas
- C - Preprocessor Operators
- C - Macros
- C - Header Files
- Memory Management in C
- C - Memory Management
- C - Memory Address
- C - Storage Classes
- Miscellaneous Topics
- C - Error Handling
- C - Variable Arguments
- C - Command Execution
- C - Math Functions
- C - Static Keyword
- C - Random Number Generation
- C - Command Line Arguments
- C Programming Resources
- C - Questions & Answers
- C - Quick Guide
- C - Cheat Sheet
- C - Useful Resources
- C - Discussion
C Tutorial
C Tutorial
C programming is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.
Why to Learn C Programming?
C programming language is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Software Development Domain. Here are some of the important reasons why you should learn C Programming −
It is a structured programming language and you can use the skills learned in C to master other programming languages.
You can use C program to write efficient codes and develop robust projects.
C is a low-level language and you can use it to interact more directly with the computer's hardware and memory.
Facts about C
C is the most widely used and popular System Programming Language. Most of the state-of-the-art software have been implemented using C. Here are some facts about the C language:
C was invented to write an operating system called UNIX. The UNIX OS was totally written in C.
C is a successor of B language which was introduced around the early 1970s.
The language was formalized in 1988 by the American National Standard Institute (ANSI).
Hello World using C Programming
Just to give you a little excitement about C programming, I'm going to give you a small conventional C Programming Hello World program. You can run it here using the "Edit and Run" button.
#include <stdio.h> int main() { /* my first program in C */ printf("Hello, World! \n"); return 0; }
Applications of C Programming
C was initially used for system development work, particularly the programs that make-up the operating system. 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 are -
Operating Systems
Language Compilers
Assemblers
Text Editors
Print Spoolers
Network Drivers
Modern Programs
Databases
Language Interpreters
Utilities
Audience
This tutorial is designed for software programmers with a need to understand the C programming language starting from scratch. This C tutorial will give you enough understanding on C programming language from where you can take yourself to higher level of expertise.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help you in understanding the C programming concepts and move fast on the learning track.
FAQs on C Programming
There are some very Frequently Asked Questions(FAQ) about C, this section tries to answer them briefly.
C programming came into being in 1972. After more than 5 decades, C is still one of the most popular languages that ranks consistently in the top three. Since C can directly interact with the hardware, it is primarily used in low-level applications such as building operating systems, device drivers, embedded systems, networking etc.
Therefore, C programming skills are very much in demand, in this age also. One’s career prospects will definitely brighter if he has a good proficiency in C programming.
C is a general-purpose programming language; therefore, it can be used to develop any type of applications. However, its ability to interact with the hardware makes it more suitable for developing system utilities, compilers and device drivers.
C is predominantly used in building embedded systems and networking applications. C is significantly faster as compared to languages like Java or Python because it is directly compiled to the machine code. Hence, it is used in development of gaming applications.
C is a versatile programming language that can be useful in development of a variety of software applications.
C is considered to be one of the easiest programming languages to learn for beginners. You can learn programming in C with the help of many online resources, such as the C tutorial provided by TutorialsPoint cprogramming.
C does have a slightly steeper learning curve when you go towards advanced concepts. For attaining a high level of proficiency in C, you need to be able to master the features such as pointers, structures etc. Learning C allows you to build sound foundation with which you can easily learn other programming technologies.
Here are some of the main advantages of learning C programming:
C is a compiled language. It is translated directly into the machine language. That’s why the code execution is faster. Thus C offers better efficiency as compared to Java, Python. This fature is advantageous in applications like system utilities, embedded systems game development etc.
C is a general-purpose language. Hence, it can be used to develop a variety of applications.
C code easily portable. C compilers are available on all the operating system platforms. Hence, you can build an executable on relevant OS without many changes to the code.
C is called as a middle-level language. It has all the advantages of a high level language, plus it can perform low-level memory manipulations.
A good expertise in C lets you to learn other languages very easily.
C programming language has a lot of important features that make it a unique language.
Compiled language − Unlike many of the modern languages, C is a compiled language. The compiler builds a machine level code that is directly executed by the processor. Hence, it provides a better performance.
Pointer mechanism − C has the ability to directly access the computer’s memory through its pointer mechanism. This leads to its ability to control the hardware – a feature that is useful in developing system utilities and embedded systems.
Functions − You can develop an application in a structured and modular manner with the help of functions. The mechanism of calling functions can be easily plugged into one another.
Extensible − C has the feature of defining a new data type by combining any of the built-in types. You can thus simulate real-life data structures with C code.
Library functions − C software is bundled with a large library of utility functions and macros. There are library functions for IO operations, string handling, mathematical and statistical functions, time related functions etc.
Every programming language has its own characteristic features and difference with others. Here are some of the key points of difference between C and other languages:
C is a compiled language, whereas programming languages like Python, Java and JavaScript are interpreted languages.
C is a statically typed language. On the other hand, Python and JavaScript are dynamically typed languages.
C is an imperative and procedural language. It doesn’t support classes and objects. Modern languages are primarily object-oriented.
C doesn’t have automatic garbage collection mechanism, which is provided by many other languages like Java and Python.
A reasonable proficiency in C can be of a lot of advantage for anybody who wants to build a career in software development. C being a general-purpose language, you can use it in different practice projects. C is an open-source language. You can also contribute to open source software development project, that will give you lot of exposure.
A C programmer can pursue a successful career in embedded system development and gaming field. C language acts as a gateway to the software development field, as you can diversify into other programming technologies.