1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Travka [436]
3 years ago
8

Hello! I am a new coder, so this is a simple question. But I am trying to create a code where you enter a number, then another n

umber, and it divides then multiply the numbers. I put both numbers as a string, and as result when i tried to multiply/divide the numbers that were entered, an error occurred. How can i fix this?
using System;

namespace Percentage_of_a_number
{
class Program
{
static object Main(string[] args)
{
Console.WriteLine("Enter percentage here");
string Percentage = Console.ReadLine();


Console.WriteLine("Enter your number here");
string Number = Console.ReadLine();

String Result = Percentage / 100 * Number;


}
}
}
Computers and Technology
1 answer:
slavikrds [6]3 years ago
6 0

no longer returns an error but your math seems to have something wrong with it, always returns 0

Console.WriteLine("Enter a percentage here");

   int Percent = int.Parse(Console.ReadLine());

   Console.WriteLine("Enter your number here");

   int Number = int.Parse(Console.ReadLine());

   int result = Percent / 100 * Number;

You might be interested in
What is the abuse of electronic messaging systems to indiscriminately send unsolicited bulk messages, many of which contain hoax
Ilya [14]

I think the answer is spam
5 0
2 years ago
100 POINTS + BRAINLYEST TO FIRST PERSON THAT IS CORRECT!!! Tomika wants to create a cell style for her workbook and share it wit
andrew11 [14]

Answer:

Go to the Home tab on the ribbon and the group Styles.

Left Click Cell Styles, then click New Cell Style and create the style.

To share it with other workbooks, use the Merge Styles function in the same group.

Explanation:

This info was for excel.

Please mark brainliest!

6 0
3 years ago
Read 2 more answers
A car manufacturer uses'simulation software during the design process for a new car. Which of the
exis [7]

D I,II and III is the answer i think

5 0
3 years ago
Which property do you use to align an element horizontally with the left or right edge of its parent element?
Ugo [173]
A thank me later:) give me hearts
3 0
2 years ago
Can you guys report my last question trying not to get caught for cheating all questions please
AfilCa [17]

Answer:

Yes

Explanation:

mark as best answer please

7 0
3 years ago
Other questions:
  • The first character of the VIN designates which of the following? 
    15·2 answers
  • Which would take more storage space, a layer file showing all the us counties or a layer file showing all the us states?
    8·1 answer
  • Largest of five (5 points). Write an algorithm that read 5 distinct integers and displays the largest value. Assume the input va
    14·1 answer
  • How might an engineer test a computer chair for comfort?
    10·1 answer
  • Ricardo twists his ankle at work but does not immediately realize that he is injured because his ankle is not sore or swollen, a
    5·1 answer
  • How does the use of the computer impact businesses
    13·1 answer
  • Which PlayStation was the first to allow connection between it and computer network
    12·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts)Ex:Davy's auto shop servicesOil chan
    9·1 answer
  • Which of the following is NOT one of the four steps preparing for sales forecast ?
    10·1 answer
  • Assume the size of an integer array is stored in $s0 and the address of the first element of the array in the memory is stored i
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!