Good Day Mr. Sachin Singh
Could you solved this ?
The output is like this:
*******
*****
***
*
Here is my code
int y;
for (int x = 0; x < 7; x++)
{
for (y = 0; y <= x; y++)
{
//if (y==0 || y==x || x==16)
if (y % 2==0)
{
Console.Write("");
}
else
{
Console.Write("*");
}
}
Console.Write("\n");
}
Srinivasan RamamoorthiPosted Oct 14, 2021, 3:34 PM
Srinivasan RamamoorthiPosted Oct 15, 2021, 8:53 AM
Ahmet TahaPosted Oct 15, 2021, 8:00 AM
The output should be like this:
input number : 10
even number : 2 4 6 8
odd number number : 3 5 7 9
here is my code
Ahmet TahaPosted Oct 14, 2021, 3:37 PM
Ahmet TahaPosted Oct 14, 2021, 3:30 PM
Srinivasan RamamoorthiPosted Oct 14, 2021, 3:23 PM
Try this... You can achieve the same without mod function
for ( int x = 7; x>=1; x=x-2)
{
for (int y = x; y>=1; y--)
{
console.write("*");
}
console.write("\n");
}
Srinivasan RamamoorthiPosted Oct 14, 2021, 3:10 PM
Try this one