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

    Translate

    Protected by Copyscape