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 method and function in c#?

0 Answers  


Do loops in c#?

0 Answers  


What is decimal in c#?

0 Answers  


Explain the features of an abstract class in net.

0 Answers  


What is xml serialization in c#?

0 Answers  


What's c# ?

0 Answers  


Explain manifest & metadata?

5 Answers   IBM, Wipro,


How many constructors can a class have in c#?

0 Answers  


What is tpl in c#?

0 Answers  


Can a loop recorder detect a heart attack?

0 Answers  


What are the characteristics of c#?

0 Answers  


Is stringbuilder better than string?

0 Answers  


Categories