Сложение двух шестнадцатеричных чиселC#

Место общения программистов C#
Ответить
Anonymous
 Сложение двух шестнадцатеричных чисел

Сообщение Anonymous »


I saw something similar on this site, but it's not excatly what I looked for. I need to make calculator of hexadecimal numbers in Visual Studio as desktop application. I need adding, subtraction, multiplying, division, square root, % and xor. It's my homework but it's kinda to hard form me. Program should work in this way: I'm working in viusal studio in windows forms, i have interface of calculator with buttons and label. Text is guided by buttons and it appears in label. For ex. I'm clicking 1, then + and 1 despaers, then I'm clicking 3 and then =, 3 desapers and the result 4 appears, ofc in decimal system.

I tried to work with chat GPT but it doesnt worked. I tried some functions and methods, but it didnt work for me. I tried to assign letters to numbers. I have totaly no idea how to get this task done. Here.s some code:
if (option.Equals("+")) { num1 = Convert.ToInt64(text); string num1s = num1.ToString("X"); int i = Convert.ToInt32(num1s, 16); result = i; }

Источник: https://stackoverflow.com/questions/780 ... al-numbers
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»