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 is difference between array and list in c#?

0 Answers  


What is system console writeline in c#?

0 Answers  


Can a method return multiple values in c#?

0 Answers  


what kind of questions (.net)to expect in a telephonic interview.This is the first time i will be facing a tele interview .Any inputs regarding this??

2 Answers   iNube Software Solutions,


What is the difference between add and addrange in c#?

0 Answers  


Which are access modifiers available in c#?

0 Answers  


List down the differences between “dispose” and “finalize” methods in c#.

0 Answers  


What is interface used in c#?

0 Answers  


What?s a delegate?

2 Answers  


Can you prevent your class from being inherited and becoming a base class for some other classes?

5 Answers  


What is the difference between interface and functional interface?

0 Answers  


What is IL / CIL / MSIL?

0 Answers   CitiusTech,


Categories