1
using System;
class teste {
static void Main(string[] args)
{
float nota1, nota2, MEDIA;
med1;
nota1=float.Parse(Console.ReadLine());
nota2=float.Parse(Console.ReadLine());
MEDIA=((nota2+nota1)/2);
string med1 = MEDIA.ToString("0.00"); //EU GOSTARIA DE IMPRIMIR O VALOR COMO EX: 7.5 E NÃO 75,0
Console.WriteLine(media1);
}
}
"I WOULD LIKE TO PRINT THE VALUE AS EX: 7.5" if you want the dot format do only
.ToString()
– Ricardo Pontual
This answers your question? Modify note value output
– Icaro Martins
What are the values passed to Nota1 and nota2? Pq being passed the correct values you need do nothing.
– tvdias
"75.0 would be 7.5" - This is confusing, because
75,0
is seventy-five, and7,5
is seven and a half, and the question is still said "7.5 AND NOT 75.0" (that is, in addition to changing the value, also changed the point instead of the comma). Your problem is that the value is going wrong, it is only formatting (number of decimals, decimal separator, etc), or both?– hkotsubo