Skip to content

Instantly share code, notes, and snippets.

View w3farid's full-sized avatar

Farid Ahmed w3farid

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<html>
<head>
<title>Print Test Page</title>
<script>
printDivCSS = new String ('<link href="myprintstyle.css" rel="stylesheet" type="text/css">')
function printDiv(divId) {
window.frames["print_frame"].document.body.innerHTML=printDivCSS + document.getElementById(divId).innerHTML;
window.frames["print_frame"].window.focus();
window.frames["print_frame"].window.print();
}
@w3farid
w3farid / Factorial.java
Created March 4, 2016 04:59
Calculate Factorial Value of a number?
import java.util.Scanner;
public final class Factorial {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("Check Factorial number: ");
int a=s.nextInt();
int fc=1;
int i=1;
while (i<=a) {
@w3farid
w3farid / PrimeNumberChecker.java
Created March 4, 2016 04:45
Giving input in runtime and checked whether it is prime on not prime?
import java.util.Scanner;
public class PrimeNumberChecker {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int a=s.nextInt();
int i=1;
int count=0;
while (a>0) {
do{
@w3farid
w3farid / LargestNumberAmongThreeNumber.java
Created March 4, 2016 04:26
Calculate the largest number among the three number?
import java.util.Scanner;
public class LargestNumberAmongThreeNumber {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int a,b,c,d;
System.out.println("Enter all three numbers: ");
a=s.nextInt();
b=s.nextInt();
c=s.nextInt();
@w3farid
w3farid / OddEven.java
Created March 4, 2016 04:20
How to calculate Odd Even Number by java
import java.util.Scanner;
public class OddEven {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Calculate the Odd or Even: ");
//check odd even number...........
int a=sc.nextInt();
do{
//check formula 10%2==0 ;