Beruflich Dokumente
Kultur Dokumente
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
1/1
17
Class Tax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
1/1
35
36
37
38
39
Class Q1_ISC2015
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1/2
import java.util.*;
public class Q1_ISC2015
{
int sumDig(long n) // Function to find sum of digits of a number
{
int sum = 0, d;
while(n>0)
{
d = (int)(n%10);
sum = sum + d;
n = n/10;
}
return sum;
}
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
int'
/* The required number must be greater than 'm',
so loop will go on as long as that n umber is not obtained.
39
40
*/
41
42
43
44
45
46
while(ob.sumDig(i)!=n)
{
i=i+1;
}
System.out.println( "The required number = " +i);
System.out.println( "Total number of digits = " +ob.countDig(i)
Mar 7, 2015 8:21:08 PM
);
}
47
48
49
2/2
50
Class Magic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
1/2
48
49
50
51
52
2/2
53
54
Class RotateArray
1
2
3
4
5
6
7
8
9
10
1/2
11
12
13
14
15
16
if(m<3 || m>9)
System.out.println("Size Out Of Range" );
else
{
int A[][]=new int[m][m];
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
2/2
}
System.out.println("*************************" );
52
53
54
55
56
57
10
11
12
13
14
15
16
*************************
Matrix After Rotation is :
13
14
10
15
11
16
12
*************************
Sum of the corner elements = 34
Class Prime
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
1/1
23
24
Class Pattern2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1/1
29
30
Class Pattern3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1/1
29
30
Class LinearSearch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1/1
26
27
28
Class Factorial
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1/1
19
20
Class Birthday
1
2
3
4
1/2
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
2/2
51
Enter no of people: 38
Enter no of times to be run: 1000
Percentage = 87.0%
found =870
total = 1000
time = 8062
Class Diamond1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
1/1
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Class palindrome
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
1/1
25
26
27
Class SumOfPrimes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
1/1
//Program to print sum of primes till a certain limit defined by the user
import java.io.* ;
public class SumOfPrimes
{
InputStreamReader isr = new InputStreamReader (System.in);
BufferedReader br = new BufferedReader(isr);
public void main(String[]args) throws IOException
{
System.out.println("Enter the maximum limit" ) ;
int n = Integer.parseInt(br.readLine());
int sum=0; int flag=0;
for(int i=2 ; i<=n ; i++)
{
for(int j=2 ; j<i ; j++)
{
if(i%j==0)
flag = 1 ;
}
if(flag==0)
{
sum=sum+i;
}
flag=0;
}
System.out.print("The Sum of prime numbers till " +n+ " is : " +s
um);
}
}
28
Class SwitchCase
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1/1
/* Program to Implement Switch Case and Print the day as per user choice.
*/
public class SwitchCase
{
public void Switch(int day)
{
String ans ;
switch(day)
{
case 1: ans="Sunday" ;
break; // Break is used here to avoid "fallthrough"
case 2: ans="Monday" ;
break;
case 3: ans="Tuesday" ;
break;
case 4: ans="Wednesday" ;
break;
case 5: ans="Thursday" ;
break;
case 6: ans="Friday" ;
break;
case 7: ans="Saturday" ;
break;
default: ans="Wrong Day Number!" ;
break;
}
System.out.println(ans);
}
}
Class ImageMatrix_ISC2013
1
2
3
4
5
6
7
8
1/2
import java.io.*;
public class ImageMatrix_ISC2013
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the size of the square matrix : " );
int m=Integer.parseInt(br.readLine());
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
2/2
{
for(int j=0;j<m;j++)
{
System.out.print(B[i][j]+"\t");
}
System.out.println();
}
}
else
System.out.println("Output : Size Out Of Range" );
}
}
10
11
12
13
14
15
16
*********************
The Mirror Image:
*********************
4
12
11
10
16
15
14
13
Class SortSearch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
1/2
49
50
51
52
}
if ( first > last )
System.out.println(search + " is not present in the list." );
53
54
55
56
57
2/2
58
Class HCF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
1/1
25
26
Class FactorialWithRecursion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1/1
29
30
31
32
33
34
Class FibWithRecursion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
1/1
27
The fibionacci of 6 is : 5
Class BinarySearch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
1/1
41
42
Class BubbleSort
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
1/1
30
31
32
33
34
35
36
37
38
39
40
Class SelectionSort
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1/1
26
27
28
29
30
31
32
33
34
35
Class InsertionSort
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
1/1
36
37