Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

c tokens keywords and identifiers


Tokens are Building Blocks of C programming.




Token Definations

Keyword: A variable is meaningful of data storage in computer memory. when using a variable you refer to memory address  of computer.
Constants:Constants are expressions with a fixed value.
Identifiers: The term identifier is usually used for variable name.
String: Sequence of characters.
Operators: A symbol that represent mathematical or non-mathematical operation.
Special symbols: Symbols other than alphabets digits and whites paces.

Token Example

SNo Token Type Example1 Example2
1 keyword for switch
2 constants number Sum
3 Identifier -120 14
4 string "abc" "prni"
5 operators ++ --
6 special symbols * @


Keywords of C programming language
  1. keywords already defined by compiler.
  2. Cannot be used as a variable name.
  3. There are 32 keywords in c.
  4. Those are also known as Reserved keywords.
32 keyword of c language


auto double struct int
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
7Search.com - Affordable PPC Advertising - Quality Traffic and Low Bid Prices Equal a Better ROI


Variables in C

Variable in c is also called as Container to store the data
Variable name may have different datatypes to identify the type of value to stored.
Suppose we declare variable of type integer then it can store only integer values
A variable is a name given to the meory location whre the actual data is stored

Rules for Constructing variable in c

  1. Characters allowed: Underscore(_),Capital Letters(A-Z),Small Letters(a-z),and digits(0-9).
  2. Blank spaces and commas are not allowed.
  3. No special symbols other than Underscore (_) not allowed.
  4. First character should be alphabet or Underscore.
  5. Variable name should not be reserved keywords.
Variable declaration in c
  • To declare is nothing but represent variable.
  • Only variable name and its datatype is represent at declaration
  • Declaration is used for identification of data type.
Examples of Declartion
int var;Here int is Integer datatype var is the variable name
float var; var is floating data type.
char var; var is here character data type.
Types of Variable in C
  1.  Local variable 
  2. Global variable
Local Variables
  1. Local variable is having local scope.
  2. Local variable is accessible form function only or block in in which it is created.
  3. Local variable is given higher priority than the global variable.
Global variables
  1. Global variable is variable that is globally available.
  2. Scope of Global variable is throughout the program.[i.e all functions including main()]
  3. Global variable is also visible inside function,provides  that it should not declared " High priority is given to local variable than Global
  4. Global variable can be accessed form any function

Over view of C

Chapter-2


Features of C Language

C is widely used language .It provides lot of features given below.
1.Low Level Features
  •    C program provides  a low level features that are generally provided by the lower level language.
2.Machine Independent or Portable
  • C programs can be executed in any machines with little bit or no change. But it is not platform independent.
  • Compiler and Processor make it possible for C program to run it on every system. 
3.Rich Library
  • c provides the lot of inbuilt functions that provides development fast.
4.Efficient use of Pointers
  • Pointers has direct access to memory.
  • We can use pointers for memory structures,functions,array,etc 
5.Speed: The compilation and execution of c language is fast.
6.Simple

  • C is a simple language it provides structured approach ,datatypes,rich set of library functions.etc.
7.Recursion
  • In c we can call the function with in the function. It provides code re usability for every function.
Applications of C-Programming Language

  1. C Language is used for creating Computer Applications.
  2. Used in Embedded systems.
  3. C is used in implement different operating system operations.
  4. Unix kernel is completely developed in C language
C-programming Tips and Remember all the things write c program
  • Every c Program must and should have one main() function only.
  • C program execution always start from main() function.
  • In c program all statements are written in lower case letters.
  • Every c statement must and should end with semicolon.

History of C

Chapter:1
There is a similarity between the human actions and the way a computer functions.Nicholas Wirth the inventor of computer language Pascal used to Say A program is equal to Algorithm + Data.

By Describing the Step-by-Step process is called as Algorithm
By representing the various steps in the form of Pictorial representation is know as Flowchart.

Algorithm: The term Algorithm is very popular in computer literature. An Algorithm is also called as Pseudo code. It is very simple to understand, in fact we all are perform hundreds of algorithms in our daily life without realizing it.
Algorithm is step-by-step method of performing any task. When we break up big task into smaller steps, what we actually do is create an algorithm. In algorithm each step is called as Instruction.

Example of Algorithm for making Tea.

  1. Begin
  2. Boil Water.
  3. Put tea powder in the kettle.
  4. Pour Boiled water in he kettle.
  5. Wait for Three minuets.
  6. Boil Milk.
  7. Put Boiled Milk in cup.
  8. Add sugar to the cup.
  9. Empty the kettle in the cup.
  10. Stir the cup with spoon.
  11. End.
Flow chart:
There is another way to write the steps involved in any process.This is by making use of various symbols.The symbols from a diagram that represents the steps in a picotial fashion similar to an algorithm. This is also very easy to understand.Such diagram is called Flow chart. In its simplest form, a flow chart consists of a series of rectangles connected each other by others.

History of C Language

Before C Language we have some more languages those are also having same principles.
  1. ALGOL (Algorithm oriented language) developed in 1960 by International Group.
  2. BCPL (Basic combine programming language) developed in 1967 by Martin Richard.
  3. B language was developed in 1970 by Ken Thompson.
  4. After Many years many of the features derived form B Language that's why name has C.
  5. C Language Was developed by Dennis Ritchie in 1972.
  6. C language was created for specific purpose i.e designing the unix operating system.
  7. After 7-8 years C++ came into world that was the first Object Oriented Programming language.
C Programming History
Lnguage Year Developed By
Algol 1960 International Group
BCPL 1967 Martin richards
B 1970 Ken thompson
C 1972 Dennis ritchie

Father of C-Language : DENNIS RITCHIE photoshop tutorial java program programming language

About


This blog provides the information about the computer basics,programming languages, Accounting packages and etc.
Here we provide easy manner to understood each and every thing in simple format.You just click the post and read it or learn easyy from our blog.

Some important topics we covered.

Shortcut keys of Windows
Short cut keys of Ms-Word,Ms-Powerpoint,Ms-Excel
TallyShort cut keys