Sunday, 17 September 2017

OPERATOR IN C

OPERATOR IN C:  

An Operator is a symbol which operates on variables. * is a operator It will multiplies the both operands.There are some operators in c

  • Arithmetic operator
  • Assignment operator
  • Relational operator
  • Logical operator
  • Bit wise operator
  • Conditional operator or Ternary operator 
  • Increment and Decrement operator
  • Special operator 

Arithmetic Operator :

 Arithmetic operator will performs mathematical operations such as addition,subtraction,multiplication,division and modules.


Operator
Description
example
+
It will add two operands
A+B=C
-
It will subtracts second operand from the first operand
A-B=D
*
It will multiplies both operands
A*B=C
/
It divides numerator by de-numerator
B/A=C
%
The Modulus operator and remainder of after an integer division
B%A=2
++
It is a increment operator to increase the integer value by one
A=A+1
--
It is a decrement operator it will decreases the integer value by one
A=A-1



Tuesday, 5 September 2017

DATA TYPES IN C

DATA TYPES IN C

Data Types are used to declare a variables or functions of different types. The variables are use to store the data. The datatypes are to see how much data will occupies in storage There are 4 data types in c

  • INT 
  • FLOAT
  • CHAR
  • DOUBLE

  • 1) Int: integers are the whole numbers that have positive and negative values and no decimal values  ex:1,-3,0
  • int is also a keyword in c to declare the variables  
  • ex: int a;
  • here a is a variable 
  • The size of int is 2 bytes in (32 bit ) 4 bytes in (64 bit) operating systems
  • The range of integer data type is -32,768 to 32,767
2)  Float: Float variables can hold fractional and real numbers such as 23.54,58.2.
we can use a keyword float to declare the fractional values in c
ex: float bill;
here float is a keyword and bill is variable.
The size of float data type is 4 bytes. its range is1.2E-38 to 3.4E+38
  
3) char: Char is a datatype to use to declare character data
ex:char name=k ;
here name is a variable and the value of name is k.
The size of char data type is 1 byte.

4) double:
The size of (Double precision data type) is 8 bytes.
The keyword double is used to declare the real numbers 
ex:double book price; 
The range is 1.7E-308 to 1.7e +308

Friday, 1 September 2017

KEYWORDS AND TOKENS

KEYWORDS IN C

There are some reserved words in c called Keywords

  • RESERVED WORDS = (some words are saved in compiler )
  • And all keywords have standard predefined meanings and it can be used only for purpose intended. and every keyword must be written in lower case. they cannot be used as user-defined identifiers.
  • IDENTIFIERS(the user will create the identifiers)

There are some few keywords here

auto      break      case     char     const
continue  default   do       double       else
if   int   long   short   while   goto   for


C TOKENS IN C 


  • Tokens are used to build a program. 
  • each and every smallest unit in a c programe known as c token.There are six tokens in c


TOKEN                                                                                   USAGE
1. keywords                                                                   do,int,for,etc.
2. identifiers                                                                 area,sum,total
3.constants                                                                  pie value,10,20
4.operators                                                                  +,-,*,
5.strings                                                                      "collage"
6.special symbols                                                        #,!,[],{} etc



OPERATERS

"Don't Review Skip": Fans Troll Tim Paine For Poor DRS Challenge On Day 3

India vs Australia: Tim Paine was again in the firing line as his poor DRS call against Mayank Agarwal cost Australia a review on Day 3 of t...