C language is used to mathematical, business and scientific environments. Every language supports some pre-defined functions and keywords.
Using those functions and keywords we can write any type of program statements.
C language is one of most popular language in today’s programming language. A program is a group of statements or set of instructions.
c language who invented
In 1960, The Cambridge university was introduced a programming language called BCPL (Basic Combined Programming Language). It is also called a ‘B’ Language. After that ‘B’ Language was modified by “Dennis Ritchie” in 1972 at AT&T Bell Lab’s. The New language named called ‘C’ language. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, known as the K&R standard. Then C language has now become a widely used professional language for various reasons.
Characteristics of C Language
- Easy to learn
- Structured language
- Powerful programming language
- It can handle low-level activities.
- It produces efficient programs.
- It can be compiled on a variety of computer platforms.
C Program Structure
In a basic C program structure the following things are involved.
- Preprocessor declaration (Header files, etc.)
- User-defined function prototype declaration (if any)
- Global variable declaration (if any)
- Main function body
- User-defined function body (only declared function bodies are build here)
A simple structure read more…
C Basic Syntax
To write a c program you must have a basic knowledge of C syntax’s. You have seen a basic structure of C program, so it will be easy to understand other basic building blocks of the C programming language Read more…
C Data Types
Basic data types in the c language are character, integer, floating point and double floating point. These are declared as char, int, float and double respectively. The size and range of these data types may vary based on processors and compilers.
Basic data types may have various modifiers preceding them. A type modifier alters the meaning of the base type to more precisely fit a specified need. The list of modifiers is as follows Read more…
A variable is a named location in memory that is used to hold a value of a particular data type that value can be changed by program. Every variable has a name and value. There are limitations on what should be variable name. A variable name must satisfy the following Read more…
C Constants and Literals
A constant is fixed values which cannot change the meaning of value during program execution. Basically constants are two types
- Numerical Constants
- Integer Constants
- Real(Float) constants
- Character Constants
- Single character Constants
- String Constants
- Numerical Constants
C Storage Classes
A storage class defines the scope (visibility) and life-time of variables and/or functions within a C Program. These specifiers precede the type that they modify. There are the following storage classes, which can be used in a C Program
An Operator is a symbol it tells the compiler either do mathematical and logical calculations. Operators are performing to any calculations on variables. We have already seen some operators + – * / and so on. In C Language operators are dividing into the following categories.
- Arithmetic Operators.
- Relational Operators.
- Logical Operators.
- Conditional Operator.
- Assignment Operator ( = )
- Increment and decrement operators.
- Bitwise operator.
- Other Operators.
Decision Making in C
Decision making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.
There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on.
Programming languages provide various control structures that allow for more complicated execution paths
A loop statement allows us to execute a statement or group of statements multiple times and following is the general form of a loop statement in most of the programming languages
Function is a group of statements that together perform a task. A function is also called as method or a sub-routine or a procedure, etc.
C Scope Rules
A scope in any programming is a region of the program where a defined variable can have its existence and beyond that variable cannot be accessed. There are three places where variables can be declared in C programming language.
Inside a function or a block which are called local variables
Outside of all functions which are called global variables.
Click here for more about c language basics
If we want to perform some task we can write some statements based on that find out the result.