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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Enlist the different types of classes in c#?

934


If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface?

1020


What is boxing in c#?

990


What are desktop applications examples?

961


What is delegate in c#?

965


How does aspect oriented programming work?

961


Explain About Virtual functions and their use.

1038


What is the usage of OLE?

1017


What is or operator in c#?

964


Can a class have static constructor?

1001


Can we have two main methods in c#?

974


What is default class in c#?

934


What is a deadlock lock?

936


Why do we use reflection in c#?

953


You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?

935