Ciao Ragazzi,
Non capisco perché il codice sottostante riporta l’errore “ not all code paths return a value”
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int totalPrice = Convert.ToInt32(Console.ReadLine());
Discount(totalPrice);
}
//complete the method declaration
static int Discount(int x)
{
if(x>10000)
{
x=(int) (x*0.;
Console.WriteLine(x);
}
else
{
Console.WriteLine(x);
}
}
}
}