-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRashed.java
More file actions
71 lines (60 loc) · 1.3 KB
/
Copy pathRashed.java
File metadata and controls
71 lines (60 loc) · 1.3 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import java.util.Scanner;
import javax.lang.model.type.PrimitiveType;
class c
{
int roll;
void set_roll(int r)
{
roll=r;
}
int get_roll()
{
return roll;
}
}
class d extends c{
int i,n,j,k;
void show()
{
System.out.println("enter the roll:\n");
//Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
roll=sc.nextInt();
do {
System.out.println("press 1 for add:\n");
System.out.println("press 2 for multip:\n");
System.out.println("press 0 for exit:");
System.out.println("enter your choose:");
n=sc.nextInt();
if(n==1)
{
System.out.println("enter the number of i is:\n");
System.out.println("enter the number of j is:\n");
i=sc.nextInt();
j=sc.nextInt();
k=i+j;
System.out.println("the totla value of k is:"+k);
}
if(n==2)
{
System.out.println("enter the number of i is:\n");
System.out.println("enter the number of j is:\n");
i=sc.nextInt();
j=sc.nextInt();
k=i-j;
System.out.println("the totla value of k is:"+k);
}
if(n==0)
{
System.out.println("exit");
}
}while(n>=0);
}
}
public class Rashed {
public static void main(String[] args) {
// TODO Auto-generated method stub
d e=new d();
e.show();
}
}