Friday 19 June 2015

C programming codes

Hi world program in c

We may store "hi world" in a character cluster as a string steady and afterward print it.

#include <stdio.h>
 
int main()
{
  char string[] = "Hello World";
 
  printf("%s\n", string);
 
  return 0;
}

Sunday 7 June 2015

The main Function:

The main is a part of every C program.C permits different firms of main state ment.
Following forms are allowed:-
1.main()
2.int main()
3.void main()
4.main(void)
5.void main(void)
6.int main(void)

The empty pair of parentheses indicates that the function has no arguments.This may be explicitly indicated by using the keyword void inside the parentheses.We may also specify the keyword int or void before the word main.The keyword void means that the function does not return any information to the operating system and int means that the function returns an integer value to the operating system.When int is specified,the last statement in the program must be "return 0".For the sake of simplicity we use the frist form in our programs.

Saturday 6 June 2015

Importance of C:

The increasing popularity of C is probably due to it is many desirable qualities.It is a robust language whose rich set of built -in functions and operators can be used to write any complex program.The C compiler combines the capabilities of an assembly language with the features of a high level language and therefore it is well suited for writing both system software and business packages.In fact many of the C compilers available in the market are written in C.Program written in C are efficient and fast.This is due to it is variety of data types and powerful operators.It is many times faster then BASIC.For example,a program to increment a variable from 0 to 15000 takes about one second in C while it takes more than 50 seconds in an interpreter BASIC.

There are only 32 keywords in ANSI C and it is strength lies in it is built-in functions.Several standard functions are available which can be used for developing programs.C is highly portable.This means that C programs written for one computer can be run on another with little or no modification.Portablity is important if we plan to use a new computer with a different OS.

History of C:

C seems a strange name for a programming language.But this strange sounding language is one most popular computer languages today beacouse it is a structured high level,machine independent language.It allows software developers to develop programs without worrying about the hardware platforms where will be implemented.The root of all modern languages platforms is ALGOL,introduced in the early 1960s.ALGOL was the first computer language to use a blog structure.Although it never hecame popular in USA,it was widely used in Europe.ALGOL gave the concept of structured programming to the computer science community.Computer sciences like Corrado Bohm,Guiseppe,Jacopini and Edsger dijkstra popularized this concept during 1960s.Subsequently several languages ware announced.In 1967 Martin Riechards developed a language called BCPL (Basic Combined Programming Language) praimarily for writing system software.In 1970 Ken Thempson created a language using many features of BCPL and called it simply B.B was used to created early versions of UNIX operating system at Bell Laboratories.Both BCPL and B were "typeless"system programming languages.Cwas evolved from ALGOL BCPL and B Dennis Ritchie at the Bell Laboratories in 1972.C uses many concepts from these languages and added the concept of data types and other powerful features.Since it was developed along with the UNIX operating system,it is strongly associated with UNIX.This operating system ,which was also developed at Bell Laboratories,was coded  almost entirely in C.UNIX is one of the most popular network operating systems in use today and the heart of the Internet data superhighway.For many years,C was used mainly in academic environments,but eventually with the release of many C compilers for commercial use and the increasing popularity of UNIX,it began to gain widespread support among computer professionals.Today C is running under a variety of operating system and hardware platforms.To assure that the C language remains standard in 1983.American National Standards Institute (ANSI) appointed a technical committee to define a standard for C.The committee approved a version of C in December 1989 which is now known as ANSI C.It was then approved by the International Standard Organization (ISO) in 1990.This version of C is also referred to as C89.During 1990's C++,a language entirely based on C,underwent a number of improvments and changes and became an ANSI/ISO approved languages in November 1977.C++ added several new features to C to make it not only a true object -oriented language but also a more versatile language.During the same period,Sun Microsystems of USA created a new language JAVA modelled on C and C++.

Process of program planning:

1.Problem identification.

2.System analysis.

3.Input-Output.

4.Algorithm development.

5.Flowchart development.

6.Programming language.

7.Program coding.

8.Program compilation.

9.Program testing and debugging.

10.Documentation.

11.Installation.

12.Maintenance.

Difference of C with other high level languages:

C language-

1. TO uses by C program solved in all of the problems.            

2.C is a portable language.

3.C language is so easy from another language.

4. Program maintenance is so easy by C languages.

5.C programming languages have no side effect.

6.C is a case sensitive language.

7.C language efficiency is so high.

High level language-

1.High level language is any programming language that enables development of a program in much                                                                                                         simpler programming context and is generally independent of the computer's hardware architecture.

2.High level language is a portable language.

3.High level language is so hard from C languages.

4. Program maintenance is so difficult by High level languages.

5.High level languages have  side effects.

6.High level language is not  a case sensitive language.

7.High level language efficiency is very low.

Program Format and Programming style in C: