Posts

Showing posts with the label C

C - Basic Syntax

You have seen the basic structure of a C program, so it will be easy to understand other basic building blocks of the C programming language. Tokens in C A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following C statement consists of five tokens − printf ( "Hello, World! \n" ); The individual tokens are − printf ( "Hello, World! \n" ) ; Semicolons In a C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity. Given below are two different statements − printf ( "Hello, World! \n" ); return 0 ; Comments Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminate with the characters */ as shown below − /* my first program in C */ You cannot have comments within comments...

First C Program and its Structure

Lets see how to write a simple and most basic C program: #include < stdio . h > int main ( ) { printf ( "Hello,World" ) ; //single line comment return 0 ; /* multi line comments /* } Hello,World Different parts of C program Pre-processor Header file Function Variables Statements & expressions Comments All these are essential parts of a C language program. Pre-processor #include  is the first word of any C program. It is also known as a  pre-processor . The task of a pre-processor is to initialize the environment of the program, i.e to link the program with the header files required. So, when we say  #include <stdio.h> , it is to inform the compiler to include the  stdio.h  header file to the program before executing it. Header file A Header file is a collection of built-in(readymade) functions, which we can directly use in our program. Header files contain definitions of the functions which can ...

Features of C language

Image
It is a robust language with rich set of built-in functions and operators that can be used to write any complex program. The C compiler combines the capabilities of an assembly language with features of a high-level language. Programs Written in C are efficient and fast. This is due to its variety of data type and powerful operators. It is many time faster than BASIC. C is highly portable this means that programs once written can be run on another machines with little or no modification. Another important feature of C program, is its ability to extend itself. A C program is basically a collection of functions that are supported by C library. We can also create our own function and add it to C library. C language is the most widely used language in operating systems and embedded system development today. C Language is an amazing language when it comes to simplicity of syntax with decent functionality. It is a perfect mix of both, which makes it the best contender to be t...

History of C Language

History of C language  is interesting to know. Here we are going to discuss brief history of c language. C programming language  was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A. Dennis Ritchie  is known as the  founder of c language . It was developed to overcome the problems of previous languages such as B, BCPL etc. Initially, C language was developed to be used in  UNIX operating system . It inherits many features of previous languages such as B and BCPL. Let's see the programming languages that were developed before C language. Language Year Developed By Algol 1960 International Group BCPL 1967 Martin Richard B 1970 Ken Thompson Traditional C 1972 Dennis Ritchie K & R C 1978 Kernighan & Dennis Ritchie ANSI C 1989 ANSI Committee ANSI/ISO C 1990 ISO Committee C99 1999 Standardization Committee

C Programming Language Tutorial

C language  Tutorial with programming approach for beginners and professionals, helps you to understand the C language tutorial easily. Our C tutorial explains each topic with programs. The C Language is developed for creating system applications that direct interacts to the hardware devices such as drivers, kernals etc. C programming is considered as the base for other programming languages, that is why it is known as mother language. It can be defined by following ways: Mother language System programming language Procedure-oriented programming language Structured programming language Mid level programming language 1) C as a mother language C language is considered as the mother language of all the modern languages because  most of the compilers, JVMs, Kernals etc. are written in C language  and most of languages follows c syntax e.g. C++, Java etc. It provides the core concepts like array, functions, file handling etc. that is being used in many ...