Commit 63bcbba8 authored by 9931099's avatar 9931099

initial commit

parents
Pipeline #5801 failed with stages
package com.company;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
// write your code here
//first program____nesbat beham avval
Scanner scanner = new Scanner(System.in);
System.out.println("enter first integer:");
int x1=scanner.nextInt();
System.out.println("enter second integer:");
int x2=scanner.nextInt();
while (x1 != x2) {
if(x1 > x2)
x1 = x1 - x2;
else
x2 = x2 - x1;
}
if(x2==1)
System.out.println("nesbat be ham avval");
else
System.out.println("nesbat be ham gheir avval");
System.out.println();
System.out.println();
System.out.println();
System.out.println();
//second program______ 10x10 jadval
for (int i=0;i<11;i++)
{
for (int j=0;j<11;j++)
{
if((i==0)&&(j==0))
{
System.out.print("*\t");
}
else if(i==0)
System.out.print(j+"\t");
else if (j==0)
System.out.print(i+"\t");
else
System.out.print((i*j)+"\t");
}
System.out.print("\n");
}
System.out.println();
System.out.println();
System.out.println();
System.out.println();
//3rd program
for (int i=0;i< args.length;i++)
{
for (char s : args[i].toCharArray()) {
System.out.println(s);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment