0
Please help me to solve the error in the following program.
import java.io.*; public class Program { public static void main(String[] args) { DataInputStream in=new DataInputStream (Syste.in); System.out.println("Enter a num"); int n=Integer.parseInt(in.reqdLine()); int i,j,k; for(i=0;i<n;i++) { k=0; for(j=1;j<(2n);j++) { if(j==n-k || j==n+k) System.out.print("*"); else System.out.print(" "); k++; } System.out.println(); } } }
7 Respostas
0
Hope I could help
+ 1
There stands Syste.in
0
Thank u for that
But it continues to show the same problem 😅
0
This is an version of your code without spelling mistakes.
As it looks like SoloLearn does nit Support
DataInputStream
SoliLearn does not even ask tye user for input...
https://code.sololearn.com/coRtwe9l6S4U/?ref=app
Mybe you look at how SoloLearn wants you to search for user Input:
https://www.sololearn.com/learn/Java/2220/
Tyen your Programm would look like this:
https://code.sololearn.com/cJ7sN69806ho/?ref=app
0
Type errors..
readLine() ; // not reqdline()
2*n, //not 2n
And as said already System.in..
0
Thank u very much I got the two problem (and some spelling errors 😝)
1. The Input part
2. The 2*n one
Thanks once again 🙏
0
Tou are welcome