how can i get this 123456789
1234 6789
123 789
12 89
1 9
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 |
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
What is multicast delegate in c# ?
What is Interface? Explain with an example.
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?
Why do we use threads in c#?
When is a class declared as a class abstract?
How does the clr work?
What is the benefit of delegate in c#?
What is alias in c#?
What is the difference between dictionary and hashtable in c#?
Is c# the same as d flat?
What is console application with example?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)