Sunday, 15 October 2017

Assignment & Relational operators

2) Assignment operator: assignment operator is used  to assign a values to a  variable. the left side of the assignment operator is a variable.the right side of the assignment operator is a value.
There are different types of assignment operators:


OPERATORS
DESCRIPTION
EXAMPLE
=    (Assignment)
It assigns a values from right side operands to left side operand
x=y
+=  (Addition assignment)
It will adds right operand to left operand and assign the result to left
x += y  is similar as x=x+y
-=  (subtraction assignment)
It will subtract the right operand from the left operand and it will assigns the result to left operand
x -= y is similar as x=x-y
*= (multiplication assignment)
It will multiply left operand with the right operand and assign the result to left operand
x*=y is similar as x=x*y
/= (division assignment)
It will divides left operand with the right operand and assign the result to left operand
x/=y is similar as x=x/y
%= (remainder assignment)
It will calculates the modulus using two operands  and it will assign the result to left operand
x%=y is similar as x=x%y


3) Relational operator: The Relational operators are used for comparison of the values of two operands. if one operand is equal to the other operand or not.There are some relational operators are
(== , > , < , <= , >=, !=)


                            Operator
          Meaning
 >
Greater than
< 
Lesser than
>=
Greater than or equal to
<=
Lesser than or equal to
==
Equal to
!=
Not equal

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



Saturday, 19 August 2017

Identifiers in c

                       IDENTIFIERS

·      Identifiers refers to the Name of program elements such as variables, functions ,and arrays.
·      Identifiers can be reasonable length of 8-10 characters through certain computers and it will allow maximum 32 characters.
·      Identifiers name must start with an alphabet or underscore followed by letter digit or combination of both.
·      The underscore (_) symbol is generally in the middle of an identifiers.
·      Identifiers are sequence of characters chosen from the set A-Z,a-z,0-9,and_ (underscore).
·      C is a case sensitive language it will differ C LANGUAGE and c language these both are different.
·      C has a list of keywords that cannot be used anywhere other than the predefined in the language.

·      EX: you should not declare the variable name as  int. because it is a keyword the vendor is already declared as predefined. Not only Int there is a 32 key words in c .

Wednesday, 16 August 2017

vairables in c

VARIABLES IN C
VARIABLE: Variable is an identifier used to store a single data item. This data could be a numerical quantity or character constant.
During execution of a Program we must   declare a variable.
·      A variable can take a different values at different times during the execution of a Program.

·      The data stored in the variable can be accessed anytime, by referring to the variable Name
Ex:  int  x=1;
int is a data type and x is a variable and 1 is a value
Above we have declared a variable and we initialized a value in variable.

 

Sunday, 13 August 2017

JAVA PROGRAMMING DATA TYPES

The int method is called only once. It is called only when the data type is created, and not called for any user requests afterwards. So, it is used for one-time to initialize the data, just as with the init method of applets.
The data is normally created when a user first invokes a URL corresponding to the servlet, but you can also specify that the data be loaded when the server is first started.
When a user invokes a servlet, a single instance of each servlet gets created, with each user request resulting in a new thread that is handed off to doGet or doPost as appropriate. The init() method simply creates or loads some data that will be used throughout the life of the servlet.
The init method definition looks like this:

ex:
public void init() throws DataException {
  // Initialization code...
}
The service() Method The service() method is the main method to perform 

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...