Czkafek
Czkafek
CC#
Created by Czkafek on 5/1/2023 in #help
How to return multiple variables?
I want to return variable win, loss and draw but i dont know how.
37 replies
CC#
Created by Czkafek on 5/1/2023 in #help
Streamreader. Double use of Streamreader
How to start reading a .txt file with streamreader from the beginning again after reading It once?
6 replies
CC#
Created by Czkafek on 4/30/2023 in #help
How to open a link from .txt file in c#?
I want to open a link from a .txt file, How can I do that?
31 replies
CC#
Created by Czkafek on 4/30/2023 in #help
.txt files reading
How to read a particular line in .txt file and write it? Console program
20 replies
CC#
Created by Czkafek on 4/29/2023 in #help
Pi practice by google
111 replies
CC#
Created by Czkafek on 4/29/2023 in #help
Method doesnt return
Hi, I am trying to do a simple calculator but my method doesnt return variable suma. How should I fix that? the code:
internal class Program
{
static void Main(string[] args)
{
int liczba1 = 0, liczba2 = 0, suma = 0;
string znak;
bool bol = false;
int i = 0;
liczba1 = Convert.ToInt32(Console.ReadLine());
znak = Console.ReadLine();
liczba2 = Convert.ToInt32(Console.ReadLine());
Dzialanie1(suma, znak, liczba1, liczba2);
while (bol == false)
{
znak = Console.ReadLine();
if(znak == "+" || znak == "-" || znak == "/" || znak == "*")
{
liczba1 = Convert.ToInt32(Console.ReadLine());
Dzialanie2(suma, znak, liczba1);
}
else
{
bol = true;
}
}
Console.WriteLine("Koniec programu, wciśnij enter aby zakończyć");
Console.ReadLine();

}
internal class Program
{
static void Main(string[] args)
{
int liczba1 = 0, liczba2 = 0, suma = 0;
string znak;
bool bol = false;
int i = 0;
liczba1 = Convert.ToInt32(Console.ReadLine());
znak = Console.ReadLine();
liczba2 = Convert.ToInt32(Console.ReadLine());
Dzialanie1(suma, znak, liczba1, liczba2);
while (bol == false)
{
znak = Console.ReadLine();
if(znak == "+" || znak == "-" || znak == "/" || znak == "*")
{
liczba1 = Convert.ToInt32(Console.ReadLine());
Dzialanie2(suma, znak, liczba1);
}
else
{
bol = true;
}
}
Console.WriteLine("Koniec programu, wciśnij enter aby zakończyć");
Console.ReadLine();

}
21 replies