Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
harish reddy
2k
162
26.2k
Random class excercise
Mar 18 2018 10:52 PM
I am trying to print phrase and stories randomly. but i am getting the full as it is...everytime i complie i should get a random message whcih i am not getting. pls help. also knindly give me some links where i can practice classes and objects with constrcutors.
Random rnd = new Random();
string[] phrase = new string[] { "The product is excellent., This is a great product., I use this product constantly., This is the best product from this category." };
string[] stories = new string[] { "Now I feel better.", "I managed to change.", "It made some miracle.", "I can’t believe it, but now I am feeling great.", "You should try it, too. I am very satisfied." };
Console.WriteLine("{0}", phrase[rnd.Next(4)]);
Console.WriteLine("{0}", stories[rnd.Next(5)]);
Reply
Answers (
4
)
Publish - Entity Framework Migrations option missing
.net vs Salesforce career scope