C# Program to Print half Diamond shapes using numbers 1 to 10
Program Statement:
Program Statement:
Write a program to produce the following output:
1
2 3
4 5 6
7 8 9 10
Solution:
Solution:
static void Main(string[] args)
{
int i,j,k=1;
for (i = 1; i <= 4; i++)
{
for (j = 4; j >= 1; j--)
{
if (j > i)
Console.Write(" ");
else
Console.Write(" " + k++ + " ");
}
Console.WriteLine();
Console.WriteLine();
}
Console.ReadLine();
}
Since we are surrounded by different gadgets and technology in the day-to-day lives, facing errors and encountering glitches is not uncommon. Dial HP Printer Customer Care Number and get the best help.
BalasHapusIf you are don’t talk to our Yahoo Customer Service Number, Account Key boosts security by sending a prompt to your mobile phone
BalasHapus