Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how can i get this 123456789
1234 6789
123 789
12 89
1 9



how can i get this 123456789 1234 6789 123 789 ..

Answer / tanvir anwar

int n = 9; // you can use any odd number for similar pattern
int mid = (n+1)/2;
for (int i = 0; i < mid; i++)
{
for (int j = 1; j <= n; j++)
{
if (j <= mid-i || j >= mid+i)
Console.Write({0}, j);
else
Console.Write(" ");
}
Console.WriteLine();
}

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More C Sharp Interview Questions

What debugging tools come with the .NET SDK?

1 Answers  


Explain polymorphism in c# with a simple example?

0 Answers  


Define multicast delegate in c#?

0 Answers  


What is escape sequence in c#?

0 Answers  


Explain manifest in c#.

0 Answers  


Is as operator in c#?

0 Answers  


What is the differnce between Array and Hash Table?

3 Answers   Impetus, TCS,


How do you mark a method obsolete?

0 Answers  


What is difference between the "throw" and "throw ex" in .net?

0 Answers  


What is string method in c#?

0 Answers  


Is comparator a functional interface?

0 Answers  


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

0 Answers   Siebel,


Categories