Results 1 to 3 of 3

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Bunny's Avatar woof.

    Join Date
    Mar 2014
    Country
    Posts
    5,302
    Thanked
    2,875
    Thanks
    1,247
    i dont know Java but i heard its pretty similar to C# and i know that so heres my attempt

    class Program
    {
    public static void Main(string[] args)
    {
    int[] arr=new int[5];
    for(int i=0; i<arr.length; i++) //input loop
    {
    arr[i]=int.Parse(Console.ReadLine());
    }
    for(int i=0; i<arr.length; i++) //output loop
    {
    System.Console.Write(arr[i]);
    if(i=arr.length-1)
    break;
    System.Console.Write(", ");
    }
    }
    }
    Last edited by Bunny; 08-20-2018 at 09:09 PM.

  2. #2
    Chicken's Avatar WHY DAVE

    Join Date
    Jul 2012
    Country
    Posts
    174
    Thanked
    36
    Thanks
    45
    Originally Posted by Bunny View Post
    i dont know Java but i heard its pretty similar to C# and i know that so heres my attempt

    class Program
    {
    public static void Main(string[] args)
    {
    int[] arr=new int[5];
    for(int i=0; i<arr.length; i++) //input loop
    {
    arr[i]=int.Parse(Console.ReadLine());
    }
    for(int i=0; i<arr.length; i++) //output loop
    {
    System.Console.Write(arr[i]);
    if(i=arr.length-1)
    break;
    System.Console.Write(", ");
    }
    }
    }
    Thank u bunny for the help, really u dont know how that helps me lol im late asf in school. ty if anything ill just change some stuff from c# code to java

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)