public class Solution {
public static void main(String[] args) {
//write your code here
int b = sqr(5);
System.out.println("the square of 5" +b);
}
public static int sqr(int a) {
return a * a;
}
}
please help that i did that program to work but failed to satisfy the condition that program to should
display output in text how???
1. The program should output text.
task01 : task0127
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
20 March 2019, 17:20
Next time make sure to ask the question under the task, you can type 0127 in the search bar, or alternatively just hit the help button above the task window and ask a question from there. Then attach your code like this:
.
0
Guadalupe Gagnon
20 March 2019, 17:21
When you do this you wont have to copy and paste and you dont have to add pictures. It will show us all your code, what parts are not passing, and the task requirements.
0
Guadalupe Gagnon
20 March 2019, 17:23
Now your problem is that the requirements say to display the square of the number 5, which is "25", but your code outputs "the square of 525". These tasks test for specific conditions, if you add anything it is an automatic fail. Modify your code to just output the correct number and nothing further.
0