Monday, June 10, 2013

10
Jun
Posted in My Programming Skill

Inverting the Values of given Variable (NOT (~) Operator)

SOURCE CODE class bitnot {          public static void main(String args[]) {      // start of main() method.                 int a = 0, b = 5, c1, c2;     // initializing a & b of type integer.                 c1 = ~a; c2 = ~b;         // inverting...

Saturday, June 8, 2013

08
Jun
Posted in My Programming Skill

Arithmatic Operations using class

SOURCE CODE class Add {       // start of class Add. void sum(int x, int y) {       // defining method sum() and passing parameter through it. x+=y;       // Adding variable x and y, and storing result in variable x. System.out.println("\nAddition is " +x);       // printing result. }     ...
08
Jun
Posted in My Programming Skill

Increment and Decrements the Value of Variable

SOURCE CODE class IncDec {       // start class IncDec. public static void main(String args[]) {       // start of main() method. int a=10, b=15;       // initializing variables. System.out.println("Original Numbers are a="+a+ " b="+b);       // Printing the original Numbers a++;       // incrementing...
08
Jun
Posted in My Programming Skill

Modulus of a Number

SOURCE CODE class Modulus {     // start of class Modulus. public static void main(String args[]) {     // start of main() method. int a=15, b=4, c;     // Initializing and declaring variables. c=a%b;     // finding mod of a number a and storing it in variable c. System.out.println("Result is "+c);     // printing result. ...

Saturday, June 1, 2013

01
Jun
Posted in My Programming Skill

Divide One Number By Another

SOURCE CODE class Division { public static void main(String args[]) {        // start of main() method. int a=10, b=5;  // initializing a & b of type integer.  double c; // initializing c of type double.  c = a / b; //dividing a by b using "/" operator and storing in c. System.out.println("Division is : "+c);   // printing result } //...

Friday, May 31, 2013

31
May
Posted in My Programming Skill

Multiplication of Numbers

SOURCE CODE class Multiplication { public static void main(String args[]) { // start of main() method. int a=9, b=12, c;  // initializing a & b of type integer. c = a * b; //Multiplying a & b using "*" operator and storing in c. System.out.println("Multiplication is : "+c);  // printing result. } // end of main() method. } // end of class. OUTPUT Multiplication...
31
May
Posted in My Programming Skill

Subtraction of Numbers

SOURCE CODE class Subtraction { public static void main(String args[]) { // start of main() method. int a=10, b=14, c;  // initializing a & b of type integer. c = a - b; //subtracting b from a using "-" operator and storing in c. System.out.println("Subtraction is : "+c);  // printing result } // end of main() method. } // end of class. OUTPUT Subtraction is : -4 NOTE:-  ...
31
May
Posted in My Programming Skill

Sum Of Two Numbers

SOURCE CODE class addition { public static void main(String args[]) { // start of main() method.     int a=10, b=14, c; // initializing a & b of type integer.     c = a + b; // adding a & b using "+" operator and storing in c.     System.out.println("Addition : "+c);     // printing result ...
31
May
Posted in My Programming Skill

Operators in JAVA

Operators are the thing which operates on variable to produce results. They manipulate both the data and variables. JAVA provides wide variety of operators. Those are as follows:- 1)      Arithmetic Operators:- These operators are used on mathematical expressions. These operators are as follows:- Sr. No. Operator Meaning Sample Program ...

    Translate

    Protected by Copyscape