0
How can i make output like this
OHow can make output like this ( 100 is the highest mark ) I just can make output ( highest in english ) or math or science.. so how can i do it :) https://code.sololearn.com/clIT7Nnz4KeN/?ref=app This is my try
8 odpowiedzi
0
System.out.println(english+" is the highest mark");
+ 3
Your program giving correct Output what you expecting and English marks is also highest if u will change it like 40 ,30 .... then it will show next subject marks are highest.
+ 2
Bushra Zhrani ohh i understood What you saying you can print number simply .
See this try on solo ide
public class Program
{
public static void main(String[] args) {
int math = 87;
int english = 100;
int science = 50;
if (math>english && math>science){
System.out.println("math is greater " + math);
}
else if (english>math && english>science){
System.out.println("higher mark in english "+english);
}
else if (science>math && science>english){
System.out.println("highest in science "+ science);
}
else {
System .out .println ("there are two marks equal or otherwise");
}
}
}
+ 2
You can write System.out.print (math) after conditions
+ 2
Try this one
public class Program
{
public static void main(String[] args) {
int math = 87;
int english = 100;
int science = 50;
if (math>english && math>science){
System.out.print(math);
System.out.println(" is the highest mark");
}
else if (english>math && english>science){
System.out.print(english);
System.out.println(" is the highest mark");
}
else if (science>math && science>english){
System.out.print(science);
System.out.println(" is the highest mark");
}
else {
System .out .println ("there are two marks equal or otherwise");
}
}
}
0
the output is correct but i need the text of the output starting with the number of the highest mark then is the highest mark
0
https://code.sololearn.com/cmQ6rnhe5Frd/?ref=app
I want the number in the first, not last
now it's ( the highest mark 100)
I need it ( 100 is the highest mark )
how can i
0
how can i please show me