write a program in Java without using array
Attachments:
Answers
Answered by
1
import java.io.*;
class help
{
public static void main(string args[])throws IOEx
{
InputStreamReader read=new INPUT.S.R (Syst);
BufferedReader in=new BufferedReader(read);
int
system.out.println("enter donation");
n=integer.parseInt(int.readLine);
system.out.print ln("enter highest donation can be made");
s=integer.parseInt(in.readLine);
if(n>=s)
system.out.println("highest donation ="+z);
else
z=n;
}
}
class help
{
public static void main(string args[])throws IOEx
{
InputStreamReader read=new INPUT.S.R (Syst);
BufferedReader in=new BufferedReader(read);
int
system.out.println("enter donation");
n=integer.parseInt(int.readLine);
system.out.print ln("enter highest donation can be made");
s=integer.parseInt(in.readLine);
if(n>=s)
system.out.println("highest donation ="+z);
else
z=n;
}
}
jai241:
I think that this is for one input but u have to make 200 inputs
Answered by
1
max =0 ;string donar; total = 0
while (n less than equal to 200)
{
sop( "please enter name and donation")
int n = sc.next Int()
int d = sc.next Int()
if ( n is greater than max);
{
max = n
donar =d
}
}
total = total + d
sop( doner , max, total)
while (n less than equal to 200)
{
sop( "please enter name and donation")
int n = sc.next Int()
int d = sc.next Int()
if ( n is greater than max);
{
max = n
donar =d
}
}
total = total + d
sop( doner , max, total)
Similar questions