Posts

Showing posts with the label C Programming Theory

Functions | Recursion Function in C Programming | Types of Functions | Calling Function | Function Arguments | C Programming

Image
Functions                     A function is a self-contained program segment that carries out same specific well defined task.                 In other words, a number of statements grouped into a single logical unit is referred to as a function.                 A function will have carried out its intended action whenever it is accessed (i.e. wherever the function is “called”) from some other portion of the program.                 Some function can be accessed from several different places with in a program. Once the function has carried out its intended action control will be returned to the point from which function was accessed.                 Generally, a function will process information i.e. Passed to it from the 1’calling” function of the program and return a single value.                 Information is passed to the function via special identifiers called “arguments” (also called parameters) and return via the return statement.    A function  decl

Introduction to C Programming | C Programming

Image
Introduction to C Programming ±    C is a general-purpose high level language ±    Father of C – Dennis Ritchie ±    Originally developed for the UNIX operating system ±    Implemented on the Digital Equipment Corporation, PDP-11 computer in 1972 ±    The UNIX operating system and all UNIX applications are written in the C language   C has now become a widely used professional language for various reasons: ±     Easy to learn ±     Structured language ±     It produces efficient programs ±     It can handle low-level activities ±     It can be compiled on a variety of computers Why we use C? ±    C was initially used for system development work, in particular the programs that make-up the operating system ±    C was adopted as a system development language because it produces code that runs nearly as fast as code written in assembly language. ±    Some examples of the use of C might be: °     Operating Systems °     Language Compilers

Escape Sequence in C Programming | C Programming

Image
Escape Sequences in C Programming:- An escape sequence always begins with backward slash and is followed by one or more special characters.  For example:- a line feed (LF), which is referred to as new line in C can be represented as \n. Backslash character constants are special characters used in output functions. Although they contain two characters they represent only one character.

Identifiers and Keywords in C Programming | C Programming Language

Identifiers in C Identifiers refers to the name given to the entities such as variables, functions, structures etc. Identifiers must be unique. They are created to give unique name to the entity to identify it during the execution of the program. For example:- int money; double account balance; Here, money and account balance are identifiers. Rules of writing identifiers First character must be an alphabet (or underscore) Identifier names must consists of only letters, digits and underscore. An identifier name should have less than 31 characters.  Any standard C language keyword cannot be used as a variable name. An identifier should not contain a space.  Keywords in C-: Key words are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are the part of the syntax and they cannot be used as an identifier.  For example:-  int money; Here, int is the keyword that indicates money is a variable of the type in