Program to calculate factorial of given number in Java

/*Program to calculate factorial of given number*/ class P2 {     public static void main(String args[])     {         int i , number , factorial ;         number...
READ MORE - Program to calculate factorial of given number in Java

Program to implement Fibonacci series in Java

/* Program to implement Fibonacci series*/ class P1 {     public static void main(String args[])     {         int x , y , z = 0 ;         System.out.println("The...
READ MORE - Program to implement Fibonacci series in Java

Program to display first 10 even numbers and their squares

/*Program to display first 10 even numbers and their squares*/ class P3 {     public static void main(String args[])     {         int n ,count=1;         System.out.println("First...
READ MORE - Program to display first 10 even numbers and their squares

Program to demonstrate the boolean logical operators

/* Program to demonstrate the boolean logical operators */ class BoolLogic {     public static void main(String args[])     {         boolean a = true;        ...
READ MORE - Program to demonstrate the boolean logical operators

/* Program to demonstrate Bitwise Shift Operators */ class BitShift {     public static void main(String args[])     {         int A = 6, B=-6;         System.out.println("A...
READ MORE -

Program to demonstrate Multiple statements within if

/* Program to demonstrate Multiple statements within if */ class IfDemo2 {     public static void main(String args[])     {            int marks;        ...
READ MORE - Program to demonstrate Multiple statements within if

program to demonstarte if statement

/* program to demonstarte if statement  */ class IfDemo1 {     public static void main(String args[])     {         int no;         no=5;       ...
READ MORE - program to demonstarte if statement

Program to compute Permutation and Combination

Program to compute Permutation and Combination class P4 {     public static void main(String args[])     {         int i , n , r , P , C ;         int factorial...
READ MORE - Program to compute Permutation and Combination

Program to determine grade for given marks, using switch statement

/* Program to determine grade for given marks, using switch statement*/ class GradeSwitch {     public static void main(String args[])     {         int marks,index ;        ...
READ MORE - Program to determine grade for given marks, using switch statement

program to determine grade for given marks

/*  program to determine grade for given marks  */ class Grade {     public static void main(String args[])     {         int marks = 83;         String...
READ MORE - program to determine grade for given marks

Program of finding out the Greatest Common Division (GCD) or the Highest Common Factor (HCF) of the given two numbers, using while loop

/* Program of finding out the Greatest Common Division (GCD) or the Highest Common Factor (HCF) of the given two numbers, using while loop*/ class GCD {     public static void main(String args[])     {    ...
READ MORE - Program of finding out the Greatest Common Division (GCD) or the Highest Common Factor (HCF) of the given two numbers, using while loop

program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7

/* program to find the number of and sum of all integers greater  than 100 and less than 200 that are divisible by 7 */ class ForDemo4 {     public static void main(String args[])     {        ...
READ MORE - program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7

Program to display table of 15

/* Program to display table of 15  */ class ForDemo2 {     public static void main(String args[])     {         int i = 0 ;         System.out.println("Table...
READ MORE - Program to display table of 15

Program to compute sum of first 20 numbers using for loop

/* Program to compute sum of first 20 numbers using for loop */ class ForDemo1 {     public static void main(String args[])     {         int i , sum = 0 ;        ...
READ MORE - Program to compute sum of first 20 numbers using for loop

Program to demonstrate Floating-point arithmetic

/* Program to demonstrate Floating-point arithmetic */ class FloatPoint {     public static void main(String args[ ])     {         float a=10.5F,b=6.1F;         System.out.println("a...
READ MORE - Program to demonstrate Floating-point arithmetic

Program to demonstrate casting Incompatible Types

/* Program to demonstrate casting Incompatible Types */ class Casting {     public static void main(String args[])     {         byte b;         int i = 258;    ...
READ MORE - Program to demonstrate casting Incompatible Types

program to check whether number is even or odd

/* program to check whether number is even or odd */ class EvenOdd {     public static void main(String args[])     {         int no , temp ;         no = 35;    ...
READ MORE - program to check whether number is even or odd

Program to tests whether the given number is divisible by 3 and 5, both

/* Program to tests whether the given number is divisible by 3 and 5, both */ class Divby3_5 {     public static void main(String args[])     {         int no ;        ...
READ MORE - Program to tests whether the given number is divisible by 3 and 5, both

Program to find Factorial of number

/*  Program to find Factorial of number */ class Demo {     public static void main(String args[])     {         int fact=1;         for(int num=5;num>=1;num--)    ...
READ MORE - Program to find Factorial of number

Program to demonstrate continue statement with a label

/* Program to demonstrate continue statement with a label */ class ContinueDemo2 {     public static void main(String args[])     {       OUTER:for(int i =0;i<10;i++)       ...
READ MORE - Program to demonstrate continue statement with a label

Program to demonstrate continue statement

/* Program to demonstrate continue statement */ class ContinueDemo1 {     public static void main(String args[])     {         for(int i =0;i<10;i++)        ...
READ MORE - Program to demonstrate continue statement

Program to illustrate the command-line arguments

/*  Program to illustrate the command-line arguments  */ class CommandLineDemo {     public static void main(String args[])     {         for(int i =0;i<args.length;i++)    ...
READ MORE - Program to illustrate the command-line arguments

Program to demonstrates Call by Value

/* Program to demonstrates Call by Value  */ class Sample { int c,d;               void cal(int c, int d)     {              ...
READ MORE - Program to demonstrates Call by Value

Program to demonstrates Call by reference

/* Program to demonstrates Call by reference  */ class Sample {     int p,q;     Sample(int x,int y)     {         p=x;         q=y;    ...
READ MORE - Program to demonstrates Call by reference

Program that uses break as a civilized form of goto

/* Program that uses break as a civilized form of goto */ class BreakDemo3 {     public static void main(String args[])     {         boolean b = true;        ...
READ MORE - Program that uses break as a civilized form of goto

Program that uses break in nested for loop

/* Program that uses break in nested for loop  */ class BreakDemo2 {     public static void main(String args[])     {         for(int i =0;i<3;i++)        ...
READ MORE - Program that uses break in nested for loop

Program of adding first ten numbers using the while loop

/*  Program of adding first ten numbers using the while loop */ class AddWhile {     public static void main(String args[])     {         int j = 1 , sum = 0 ;        ...
READ MORE - Program of adding first ten numbers using the while loop

Program to demonstrate Access Protection

/* Program to demonstrate Access Protection */ class Demo {     int p;            // default access     public int q;    // public access    ...
READ MORE - Program to demonstrate Access Protection

Program to demonstrate type promotion

/* Program to demonstrate type promotion */ class TypePromotion {     public static void main(String args[])     {         byte b = 52;         char c = 'a';    ...
READ MORE - Program to demonstrate type promotion

Program to demonstrate the ternary Operator

/* Program to demonstrate the ternary Operator */ class Ternary {          public static void main(String args[])     {               int value1...
READ MORE - Program to demonstrate the ternary Operator

Program to calculate Remainder

/*   Program to calculate Remainder   */ class Remainder {     public static void main (String args[])     {         int i = 10;        ...
READ MORE - Program to calculate Remainder

/* Program to compute the area of a circle */ class P15 {     public static void main(String args[])     {         double pi,r,a;         r=10.8;    ...
READ MORE -

Program to demonstrate Relational Operators

/* Program to demonstrate Relational Operators */ class RelationalOp {     public static void main(String args[])     {         float x = 15.0F, y = 10.65F, z = 25.0F;        ...
READ MORE - Program to demonstrate Relational Operators

Program to convert given temperature in Fahrenheit to Celsius

/* Program to convert given temperature in Fahrenheit to Celsius */ class P16 {     public static void main(String args[])     {         double celsius1,celsius2,fahrenheit;   ...
READ MORE - Program to convert given temperature in Fahrenheit to Celsius

Program to determine salvage value

/* Program to determine salvage value */ class P14 {     public static void main(String args[])     {         double purchase_price, salvage_value,depreciation;        ...
READ MORE - Program to determine salvage value

Program to computes the length of the hypotenuse of a right triangle

/* Program to computes the length of the hypotenuse of a right triangle */ class P12 {     public static void main(String args[])     {         double a = 3.0, b= 4.0;        ...
READ MORE - Program to computes the length of the hypotenuse of a right triangle

Program to find absolute value of the variable

/* Program to find absolute value of the variable */ class P11 {     public static void main(String args[])     {         int x = -25, y =-18;         /* Using...
READ MORE - Program to find absolute value of the variable

Program to find minimum Number

/* Program to find minimum Number */ class P10 {          public static void main(String args[])      {             int a =3 , b = 7 , c...
READ MORE - Program to find minimum Number

Program to implements the quadratic formula

/*  Program to implements the quadratic formula */ class P9 {     public static void main(String args[])     {         //implements the quadratic formula        ...
READ MORE - Program to implements the quadratic formula

Program to exchange the digits of 2-digit number

/*  Program to exchange the digits of 2-digit number */ class P8 {     public static void main(String args[])     {         int number= 71, temp, tens;        ...
READ MORE - Program to exchange the digits of 2-digit number

Program to split of a 4 digit number

/*  Program to split of a 4 digit number */ class P7 {     public static void main(String args[])     {         int x = 1234, y, z;         y = x /1000 ;    ...
READ MORE - Program to split of a 4 digit number

Program to converts inches to centimeters

/*  Program to converts inches to centimeters */ class P6 {     public static void main(String args[])     {         float inches = 16.9F, cm ;           ...
READ MORE - Program to converts inches to centimeters

Program to calculate the simple interest

  /*  Program to calculate the simple interest */ class P5 {     public static void main(String args[])     {         float principle, no_of_years, rate_of_interest, simple_interest;                ...
READ MORE - Program to calculate the simple interest

Program for computing the volume of a sphere

/*  Program for computing the volume of a sphere  */ class P4 {     public static void main(String args[])     {         float r=2, volume, pi =  3.14152F;    ...
READ MORE - Program for computing the volume of a sphere

Program to interchange the value of the given 2 numbers

/* Program to interchange the value of the given 2 numbers */ class P3 {     public static void main(String args[])     {         int no1=5, no2=18, temp;        ...
READ MORE - Program to interchange the value of the given 2 numbers

Program to find Square and cube of a Number

/* Program to find Square and cube of a Number */ class P2 {          public static void main(String args[])      {     int i=5 ;         System.out.println("...
READ MORE - Program to find Square and cube of a Number

Program to calculate average of 3 numbers

/* Program to calculate average of 3 numbers */ class P1 {      public static void main(String args[])      {              int a, b, c, average;             ...
READ MORE - Program to calculate average of 3 numbers

Program to demonstrate Mathematical Functions

class P {     public static void main(String args[])     {         double x= Math.floor(40.6);         double y = Math.abs(40.6);       ...
READ MORE - Program to demonstrate Mathematical Functions

Program to demonsrate System.arraycopy() function

/* Program to demonsrate System.arraycopy() function*/ class Arraycopy1 {     public static void main(String[] args)     {             char[] copyFrom = { 'd', 'e', 'c',...
READ MORE - Program to demonsrate System.arraycopy() function

Mathematical Applications/Operators/Functions

/*  Mathematical Applications/Operators/Functions  */ import java.lang.System; import java.lang.Math; public class MathApp {  public static void main(String args[]) {   System.out.println(Math.E);   System.out.println(Math.PI);  ...
READ MORE - Mathematical Applications/Operators/Functions

Program to demonstrates the increment operator

/* Program to demonstrates the increment operator*/ class IncDec {     public static void main(String args[])     {         int a = 10;         int b = 20;   ...
READ MORE - Program to demonstrates the increment operator

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|