Skip to content

Instantly share code, notes, and snippets.

View isauravmanitripathi's full-sized avatar
🏁
1111

saurav tripathi isauravmanitripathi

🏁
1111
View GitHub Profile
public class Sum_Recursive {
private String sumString (final int n) {return "sum (" + n +")";}
private int max = 0;
private void printout (final int n, final String s) {
System.out.println( sumString(n));
for (int i = 0 ; i <= max - n; ++i) {System.out.print(" ");}
System.out.print(s);
}
private int sum(final int n) {
import java.util.Scanner;
/**
* Program to display a multiplication table where the user inputs the number of table to
* display
*
* made by: Saurav mani Tripathi
*
* published on github and medium under profile of Dammn
*/
import java.util.Scanner;
/**
* Program to check for a palindrome.
*
* by saurav mani tripathi
* for medium.com/damnn
*/
public class variables {
public static void main(String [] arguments) {
final char UP = 'U';
byte initialLevel = 12;
short Location = 13250;
int score = 3423842;
boolean newGame = true;
System.out.println("Level: " + initialLevel);
System.out.println("up: " + UP);
public class weather {
public static void main(String [] args) {
float fah = 86;
System.out.println(fah + "Degrees Fahrenheit is...");
// TO convert Fahrenheit into celsius
//Begin by subtracting 32
fah = fah - 32;
// divide the answer by 9
fah = fah / 9;
//Multiply that answer by 5
public class variables {
public static void main(String [] arguments) {
int x, y, z; // x, y, and z are all declared
x = 42; // x is given the value of 42
y = x++; // y is given x's value which is 42 before it is incremented
// and x is then incremented to 43
z = ++x; // x is incremented to 44, and z is given x's value
System.out.println("x is: " + x);
System.out.println("y is: " + y);
import java.util.StringTokenizer;
public class showToken {
public static void main(String [] args) {
StringTokenizer st1, st2;
String quote1 = "JACK 3 -1/16";
st1 = new StringTokenizer(quote1);
System.out.println("Token 1: " + st1.nextToken());
import java.awt.Point;
public class SetPoints {
public static void main(String [] args) {
Point location = new Point(4, 13);
System.out.println("Starting location: ");
System.out.println("X equals " + location.x);
System.out.println("Y equals " + location.y);
/**
* made by damnn
*/
public class demo {
public static void main(String [] args) {
boolean b;
b = false;
System.out.println("b is " + b);
b = true;
class Guess {
public static void main (String [] args)
throws java.io.IOException {
char ch, answer = 'K';
System.out.println("I'm thinking of a letter between A and Z");
System.out.println("Can you guess it: ");