Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7cb0a57

Browse files
Irani-LaptopIrani-Laptop
Irani-Laptop
authored and
Irani-Laptop
committed
first time
1 parent 95af1b3 commit 7cb0a57

File tree

12 files changed

+275
-0
lines changed

12 files changed

+275
-0
lines changed

‎P25P30/.classpath

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
4+
<attributes>
5+
<attribute name="module" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="src" path="src"/>
9+
<classpathentry kind="output" path="bin"/>
10+
</classpath>

‎P25P30/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

‎P25P30/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>P25P30</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P29.java=UTF-8
3+
encoding//src/P30.java=UTF-8
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=11
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13+
org.eclipse.jdt.core.compiler.release=enabled
14+
org.eclipse.jdt.core.compiler.source=11

‎P25P30/src/P25.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import java.util.Scanner;
2+
3+
public class P25 {
4+
5+
public static void main(String[] args)
6+
{
7+
Scanner input=new Scanner (System.in);
8+
9+
System.out.println("Please enter n:");
10+
int n=input.nextInt();
11+
12+
int p=1;
13+
for (int x=1;x<=n;x++)
14+
p=p*x;
15+
16+
17+
System.out.println(n + "! = " + p);
18+
19+
20+
}// end of Main
21+
}// end of Class

‎P25P30/src/P26.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import java.util.Scanner;
2+
3+
public class P26 {
4+
5+
public static void main(String[] args)
6+
{
7+
Scanner input=new Scanner (System.in);
8+
int n=0;
9+
10+
11+
int sum=0;
12+
for (int x=1;x<=10;x++)
13+
{
14+
n=input.nextInt();
15+
16+
//Calc
17+
18+
sum = sum + n;
19+
}
20+
21+
System.out.println("Sum is: " + sum);
22+
System.out.println("Avg is: " + sum/10.0);
23+
24+
25+
}// end of Main
26+
}// end of Class

‎P25P30/src/P27.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.Scanner;
2+
3+
public class P27 {
4+
5+
public static void main(String[] args)
6+
{
7+
Scanner input=new Scanner (System.in);
8+
int n=0;
9+
10+
System.out.println("enter number (" + 1 + ") : ");
11+
int min = input.nextInt();
12+
for (int x=2;x<=100;x++)
13+
{
14+
System.out.println("enter number(" + x + ") : ");
15+
n=input.nextInt();
16+
17+
//Calc
18+
if (n<min)
19+
min=n;
20+
}
21+
22+
System.out.println("Min is: " + min);
23+
24+
}// end of Main
25+
}// end of Class

‎P25P30/src/P28.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.Scanner;
2+
3+
public class P28 {
4+
5+
public static void main(String[] args)
6+
{
7+
Scanner input=new Scanner (System.in);
8+
int n=0;
9+
10+
System.out.println("enter number (" + 1 + ") : ");
11+
int max = input.nextInt();
12+
for (int x=2;x<=100;x++)
13+
{
14+
System.out.println("enter number(" + x + ") : ");
15+
n=input.nextInt();
16+
17+
//Calc
18+
if (n>max)
19+
max=n;
20+
}
21+
22+
System.out.println("Max is: " + max);
23+
24+
}// end of Main
25+
}// end of Class

‎P25P30/src/P28a.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import java.util.Scanner;
2+
3+
public class P28a {
4+
5+
public static void main(String[] args)
6+
{
7+
Scanner input=new Scanner (System.in);
8+
int n=0;
9+
10+
System.out.println("enter number (" + 1 + ") : ");
11+
int max = input.nextInt();
12+
int min = max;
13+
14+
15+
for (int x=2;x<=5;x++)
16+
{
17+
System.out.println("enter number(" + x + ") : ");
18+
n=input.nextInt();
19+
20+
//Calc
21+
if (n>max)
22+
max=n;
23+
if (n<min)
24+
min=n;
25+
}
26+
27+
System.out.println("Max is: " + max);
28+
System.out.println("Min is: " + min);
29+
30+
}// end of Main
31+
}// end of Class

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /