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;
}
Vipul MalhotraPosted Apr 7, 2016, 6:10 AM
NAVEEN PANERUPosted Apr 7, 2016, 6:17 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:57 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:54 AM
Nishant MittalPosted Apr 7, 2016, 5:44 AM
Shubham KumarPosted Apr 7, 2016, 5:41 AM
Vipul MalhotraPosted Apr 7, 2016, 5:33 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:29 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:27 AM
Vipul MalhotraPosted Apr 7, 2016, 5:25 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:24 AM
Vipul MalhotraPosted Apr 7, 2016, 5:21 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:19 AM
Vipul MalhotraPosted Apr 7, 2016, 5:14 AM
Shubham KumarPosted Apr 7, 2016, 5:10 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:08 AM
Shubham KumarPosted Apr 7, 2016, 5:05 AM
NAVEEN PANERUPosted Apr 7, 2016, 5:01 AM
Shubham KumarPosted Apr 7, 2016, 4:57 AM
NAVEEN PANERUPosted Apr 7, 2016, 4:57 AM
NAVEEN PANERUPosted Apr 7, 2016, 4:37 AM
Nishant MittalPosted Apr 7, 2016, 4:30 AM
NAVEEN PANERUPosted Apr 7, 2016, 4:26 AM
Nishant MittalPosted Apr 7, 2016, 3:04 AM
Vipul MalhotraPosted Apr 7, 2016, 2:47 AM