Computer Science, asked by jai241, 1 year ago

write a program in Java without using array

Attachments:

Answers

Answered by ankit3212
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;
}
}

jai241: I think that this is for one input but u have to make 200 inputs
shreyd: bhai loop me enter karaya hai
ankit3212: yeah i know taht but u must have got a hint out of it....
Answered by shreyd
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)
Similar questions