Skip to content

Instantly share code, notes, and snippets.

View RahulKirtoniya's full-sized avatar
🎯
Focusing

Rahul Kirtoniya RahulKirtoniya

🎯
Focusing
View GitHub Profile
@RahulKirtoniya
RahulKirtoniya / Internshalaques.java
Created August 19, 2022 11:33
Here is the source code of the Java Program to Find Area of Square, Rectangle and Circle using Method Overloading. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.
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) {
@RahulKirtoniya
RahulKirtoniya / gfg.java
Created August 19, 2022 11:51
When two binary strings are added, then the sum returned is also a binary string.
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);
@RahulKirtoniya
RahulKirtoniya / Rahul.java
Created August 21, 2022 03:39
Rok, Paper, Scissor
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:");