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 webapplication? what is windows application? what is the extension for both . in what purpose we r using webapplication. in which situation we r using windowns application

1 Answers  


What is multicast delegate in c# ?

0 Answers  


What is Interface? Explain with an example.

8 Answers   TCS,


If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?

0 Answers  


Why do we use threads in c#?

0 Answers  


When is a class declared as a class abstract?

0 Answers   Siebel,


How does the clr work?

0 Answers  


What is the benefit of delegate in c#?

0 Answers  


What is alias in c#?

0 Answers  


What is the difference between dictionary and hashtable in c#?

0 Answers  


Is c# the same as d flat?

0 Answers  


What is console application with example?

0 Answers  


Categories