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
How does light move? Shift? Bounce between different objects?
ZanzabumX [31]

Answer:

Bounce between different objects

Explanation:

Light probably will bounce off of objects or it might go through, i think it depends on what object and what material.

6 0
4 years ago
A section-lined area is always completely bounded or outlined by an?
Paraphin [41]
Visible outline.
hope this helps
8 0
3 years ago
There are three types of value for money. Which of the following is not a method of value?
AlladinOne [14]
The answer to this question is c
4 0
3 years ago
Consider the following code segment.
Bingel [31]

Answer:

A.)

arr[0] = 10;

arr[1] = 10;

Explanation:

Given the array:

arr = {1,2,3,4,5}

To set the first two elements of array arr to 10.

Kindly note that ; index numbering if array elements starts from 0

First element of the array has an index of 0

2nd element of the array has an index of 1 and so on.

Array elements can be called one at a time using the array name followed by the index number of the array enclosed in square brackets.

arr[0] = 10 (this assigns a value of 10 to the index value, which replace 1

arr[1] = 10 (assigns a value of 10 to the 2nd value in arr, which replaces 2

3 0
3 years ago
WHAT 1 + 1 ???? ???????????????????
antiseptic1488 [7]
The answer to this is 11
5 0
3 years ago
Read 2 more answers
Other questions:
  • Assume that the variables gpa, deansList and studentName, have been declared and initialized . Write a statement that both adds
    6·1 answer
  • ​A(n) ________ database makes it possible to store information across millions of machines in hundreds of data centers around th
    14·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • What are the principal cybersecurity threats, both internal and external, and the principal safeguards that have been developed
    13·1 answer
  • Which type of computer network ensures high quality​
    9·1 answer
  • Assume we are testing a variable is_sunny in a while loop. is_sunny = “n”.
    13·1 answer
  • When a collection of honeypots connects several honeypot systems on a subnet, it may be called a(n) honeynet
    9·1 answer
  • What is 4x+2x(-3-3) thanku
    11·2 answers
  • Write a function check_palindrome that takes a string as an input and within that function determines whether the input string i
    12·1 answer
  • Question 2 of 25
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!