BASIC INFORMATION OF C PROGRAMMING
C programming language
developed at AT and T’s bell
laboratories in new jersey.
It was designed and written by
"Dennis Richie "
C is a structure programming
language in which program is
divided into various modules .
each module can be written
separately and together it forms
a single program this structure
it easy for testing maintaining
and debugging process. It is
allow programming level
language close to machine
language it is widely used in the
software development field ,if
has the full support of various
operating system and hardware
platforms.
In computer
programming machine code,
consisting of machine
language instructions is low
level programming
language used to directly
control a computers central
processing unit (CPU) each
instruction causes the CPU
to perform a very specific task
,such as a load , store, a jump or
an arithmetic logic unit (ALU)
operation on one or more units
of data in the CPU`s registers
or memory .programming
language contains all the
features of these language and
many more additional concept
that make it unique from other
language C is powerful
programming language which is
strongly associated with the
Unix operating system even
most of the Unix operating
system is coded in c initially c
programming was limited to
the Unix operating system , but
as it started spreading around
the world it became commercial
,and many compilers were
released for cross platform .
to sure that C language will remain
standard , american national standards
institute (ANSI) defined a commercial standard for c
language in 1989 . later, it was approved by
the international standards organization (ISO) in 1990. c programming language is also called as ANSI C.C forms a base for many other languages that are currently in use.
C is what is called a compiled
language this means that once
you write your c program, you
must run it through a c compiler
to turn your program an
executable that the computer
can run.
the program is the
human readable form while
the executable that comes out
of the compiler is the compiler
is machine readable and
executable form what this
means is that to write and run c
program you must have access
to a c compiler.
why learn c?
as we studied earlier C is a base language for many programming languages . so ,learning c as the main language will play an important role while studying other programming languages . it shares the same concepts such as data types ,operators, it a simple language and provides faster execution.
c contains 32 keywords ,various data types and a set of powerful built in functions that make programming very efficient.
huge advantage of c is portability . different processors have different instruction sets. having to rewrite and maintain assembly language code for each computer architecture you wish to execute your code on is an onerous task . and so one of the main strengths of c is that it combines universality and portability across various computer architectures while still giving you the same kind of low level hardware control you get with assembly language . this means you can write your c source code once and easily compile it into binaries for use on a wide variety of machines
Structure of c Program.
Comments line
Pre processor statements :
Function proto types:
Global declarations:
Main()
{
Local declarations :
Executable statement;
}
User defined function()
{ Local declarations :
Executable statement;
}
I. Integers constants
II. Floating point constants
III. Character constants
IV. String constants
C language has two types of I/O statements
Formatted I/O Statements
Printf ( ) :P
Printf (“control string”,arguments_list);
Scanf( ):scanf is formatted input function. Scanf( )function is
used to read information from the standard input device.
General syntax
Scanf (“control string”,arguments_list);
Unformatted I/O statements
getchar( ):it reads single character from standard input
device this function don’t require any arguments .
Syntax
Char variable name =getchar( );
Putchar( ): this function is used to display one character at
a time on the standard output device.
Syntax
Putchar(char_variable );
gets ( ):this function is used to read group of characters
from the standard input device.
Syntax
Gets (character array variable );
Puts( ): this function is used to display string to the standard
output device.
Syntax
Puts(character array variable );
getch( ): this function reads a single character directly from
the keyboard without displaying on the screen . this function
is used at the end of the program for displaying the output
Syntax
Char variable _name=getch( );
getche( ): this function reads a single character from the
keyboard and echoes it to the current text window.
Syntax
Char variable _name =getche( );
Putch( ): this function display any alphanumeric characters
to the standard output device .it displays only one character at a time .
Syntax
Putch(variable_name );
No comments:
Post a Comment