- The name came about because it superseded the old programming language he was using : B.
- C was designed with one goal in mind: writing operating systems.
- The language was extremely simple and flexible, and soon was used for many different types of programs.
- It quickly became one of the most popular programming languages in the world.
Features of C
- Fast and EfficientPrograms written in C are efficient and fast. This is due to its variety of data type and powerful operators.
- PortableC is highly portable. This means that programs once written can be run on another machines with little or no modification.
- Function and Rich LibrariesC program is basically a collection of functions that are supported by C library. We can also create our own functions and add it to the C library.
- ModularityModular programming is a software design technique that increases the extent to which software is composed of separate parts, called modules.
- Easy to ExtendIn C, New feature can be added at any time by programmer.
- Case SensitiveIt is a case sensitive language, that it can differentiate the character is upper case or lower case.
IDE AND COMPILER
List of some good IDE + Compiler for C.
Code::Blocks with Mingw (We Recommend this)
- Download Link : http://www.codeblocks.org/downloads
- Available on : Windows, Linux, Mac.
It's Free
Dev C++ with Mingw/GCC
- Download Link : http://www.bloodshed.net/dev/devcpp.html
- Available on : Windows.
It's Free
What is Compiler:
What is Interpreter:
- Interpreter Takes Single instruction as input.
- No Intermediate Object Code is Generated.
- Interpreter execute conditional control statements at a much slower speed.
- Memory Requirement is Less.
- Every time higher level program is converted into lower level program.
- Errors are displayed for every instruction interpreted (if any).
- The interpreter can immediately execute high-level programs, thus interpreters are sometimes used during the development of a program, when a programmer wants to add small sections at a time and test them quickly.
Structure of C program
- C is a case sensitive language.
- C Program consist of one or more functions.
- One function that must be present in every C program is main(). This is the 1st function called up when program execution begins.
C program basically consists of the following parts:
- Preprocessor Commands
- Functions
- Variables
- Statements & Expressions
- Comments
Structure of C Program is illustrated below :
//Preprocessor directives
//Global data declarations
main() // main function
{
//Declaration part;
//Program statements;
}
//User defined functions
func1()
{
....
}
func2()
{
....
}
.
.
.
funcn()
{
....
}
Simple C program
Let's write c program to print Hello World.
PROGRAM CODE
/*Program to print a Hello World*/
//header file
#include<stdio.h>
//main function
int main()
{
//Output statement
printf("Hello World");
//returning value to function
return 0;
}
No comments:
Post a Comment