Basic of C | Geeky Shows 1



Comments



Description

Basic of CC Language – The C language is one of the powerful programming languages used to write computer programs for variety of applications. It was developed by Dennis Ritchie at Bell Lab during 1970’s. C has flexible features to write programs for numerical, commercial and graphical applications. May operating system programs for the latest computers and compilers are written using C language.                         This language was developed from B language which was modified from a language called Basic Combined Programming Language (BCPL). Salient features of C: C is a general purpose, structured programming language. Among the two types of programming languages discussed earlier, C lies in between these two categories. That’s why it is often called a middle level language. It means that it combines the elements of high level languages with the functionality of assembly language. It provides relatively good programming efficiency (as compared to machine oriented language) and relatively good machine efficiency as compared to high level languages). As a middle level language, C allows the manipulation of bits, bytes and addresses – the basic elements with which the computer executes the inbuilt and memory management functions. C code is very portable, that it allows the same C program to be run on machines with different hardware configurations. The flexibility of C allows it to be used for systems programming as well as for application programming. C is commonly called a structured language because of structural similarities to ALGOL and Pascal. The distinguishing feature of a structured language is compartmentalization of code and data. Structured language is one that divides the entire program into modules using top-down approach where each module executes one job or task. It is easy for debugging, testing, and maintenance if a language is a structured one. C symbolic constant and so on. testing. files. The basic unit of a C program is a function . An identifier can be written with a maximum 31 characters. Minus & Ampersand * Asterisk # Hash / Slash $ Dollar \ Back slash ^ Caret % Percent <  Lesser than | Vertical bar >  Greater than ~ Tilde = Equal to ? Question mark ( Open Parenthesis ! Exclamation Mark ) Close Parenthesis . Characters used in C – ·         Alphabets Upper case letters A to Z Lower case letter a to z ·         Numbers 0 to 9 ·         Special Characters + Plus “ Double Quote . do-while and for and various data structures such as strucs. function. It is used to identify a variable. The structural component of C makes the programming and maintenance easier. Full stop ] Close Bracket . Semicolon { Open Set Bracket : Colon } Close Set bracket ‘ Apostrophe _ Underscore Identifier – An identifier is a name having a few letters. It is easy for debugging.C’s standalone subroutine. and maintenance if a language is a structured one. It is a good practice to have identifiers with few letters. numbers and special character _ (Underscore). Comma [ Open bracket . C supports several control structures such as while. arrays etc.task. as would be seen in the later units. less than 8 letters is commonly followed with the first letter . float.      First character must be an alphabet or underscore. Keywords or Reserved words – C language uses the following keywords which are not available to users to use them as variables/function names. no other special symbols can be used.      Except the special character underscore ( _ ).24 etc Identifiers Sum. 2. int etc Constants -25. Same text of different case is not equivalent. auto break case enum volatile while char extern switch typedef const struct short union continu return e signed unsigne register goto d sizeof void for if static float double int default do else long Tokens – There are six types of tokens are used in C language. for example: TEXT is not same as text.      Both upper and lower cases are allowed. Generally all keywords are in lower case although uppercase of same names can be used as identifiers.      It consists of letters and digits. C Tokens Examples Keywords Auto. Ex:-             c3             sum             PI             sigma             matadd Rules for Forming Identifiers - Identifiers are defined according to the following rules: 1. 3. PI etc . less than 8 letters is commonly followed with the first letter being an alphabet.identifiers with few letters. 3. 4. PI etc String literals “Total Amount is” “Sum =“ etc Operators +. Identifiers Sum. -. * etc Separators . Watch Video Tutorial Click Below  Like it ? Share it.   :    .   .
Copyright © 2024 DOKUMEN.SITE Inc.