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
NAVEEN PANERU
NA
25
1.1k
problem while running for loop.
Apr 7 2016 1:14 AM
I designed a windows application form NAVIGATOR, and put the following code to the form.
When I am passing the parameters "string" and "int" to the function Hereitis. e.g if I pass "naveen" and "1", then It's output must be as:
HI naveen
HI naveen naveen but in second time or further as per the "numberoftimes" it always prints HI naveen only. why the value of finalstring is not getting modified each time for loop runs..????
namespace
Navigator
{
class
Talker
{
public static int
Hereitis(
string
thingTosay,
int
numberoftimes)
{
string
finalstring = " HI ";
for
(
int
count = 0; count <= numberoftimes; count++)
{
finalstring = finalstring + thingTosay + "\n";
}
MessageBox.Show
(finalstring);
return
finalstring.Length;
}
Reply
Answers (
25
)
how to build for loop for my code
crystal reports from store procedure in windows application?