My code keeps outputting a heart (C#)

Problem description

When I try to run my code, which should output a question for the user to input values, and store them in an array, the only output is a heart. I have ran the code on other online compilers such as Programiz and online GDB, and it works just fine. I have also attempted running other codes and it continuously just displays a hearr. What is going on? I’ve tried doing research btu can’t find anything at all, not sure if I am doing something wrong or there is an actual bug somewhere. Please help!

Expected behavior

Should output a question for the user to input values, and store them in an array, and display.

Actual behavior

Outputs a heart.

Steps to reproduce

Create a repl using c#
Type in the code
Click green run button at the top

Browser

Chrome

OS

Mac OS

Device if mobile

Macbook Pro

Plan

Free

Hey @LorenaLabrador, welcome to the forum!

Can you please provide a link to the Repl? This way it is easier for staff and members of the community to help you!

Also see this guide on how to share your code:

2 Likes

Here is the link: https://replit.com/@LorenaLabrador/ArrayP1?v=1

I was able to get this to work.

First I created a new C# repl.

I then copied the contents of your arrays.cs file and pasted it into the new main.cs file.

I then modified <TargetFramework> and <StartupObject> in the main.csproj file.

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
      <StartupObject>SortingApplication</StartupObject>
  </PropertyGroup>

</Project>

2 Likes