TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jake
NA
3
985
Putting a random input into a DisplayDigits code.
Jan 29 2015 8:13 PM
Console.WriteLine("Enter a number between 1 and 99999:");
num = Console.ReadLine();
DisplayDigits(num);
}
public static void DisplayDigits(string num)
{
for (int i = 0; i < num.Length; i++)
Console.Write(num[i] + " ");
}
Current code . However I need it to run with a random integer value in the place so that it does not require input.
Here is my actual HW question.
c) Use the app pieces developed in parts (a) and (b) to write a method DisplayDigits that
receives an integer between 1 and 99999 and displays it as a sequence of digits, separating
each pair of digits by two spaces. For example, the integer 4562 should appear as:
4 5 6 2.
d) Incorporate the method developed in part (c) into an app that inputs an integer and
calls DisplayDigits by passing the method the integer entered. Display the results.
Reply
Answers (
0
)
Publishing ASPX app that output Library is Class Library
short cut keys in c#