This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Internshalaques { | |
void area(float x) | |
{ | |
System.out.println("the area of the square is "+Math.pow(x,2)+" sq units"); | |
} | |
void area(float x, float y) | |
{ | |
System.out.println("the area of the rectangle is "+x*y+" sq units"); | |
} | |
void area(double x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class gfg { | |
static String add_Binary(String x, String y) | |
{ | |
String res = ""; | |
int d = 0; | |
int k = x.length() - 1, l = y.length() - 1; | |
while (k >= 0 || l >= 0 || d == 1) { | |
d += ((k >= 0) ? x.charAt(k) - '0' : 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Random; | |
public class Rahul { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner (System.in); | |
Random rand = new Random(); | |
System.out.println("welcome in rok paper scissor game"); | |
System.out.println("select\n rok for 0\n paper for 1\n scissor for 2"); | |
System.out.print("enter number:"); |