Hello Guyz I need your help,
The out put should be like ths:
Enter Number of Range : 3
1
2 3
4 5 6
The factorial Factor is : 720
and here is my code:
C#
int x; int y; int k = 1; int sum=1;
Console.Write("Enter Number of Range :\t");
int num = int.Parse(Console.ReadLine());
for (x = 1; x <= num; x++)
{
for (y = 1; y <= x; y++)
Console.Write("{0}", k++ + " ");
Console.Write("\n");
//sum += k++;
}
Console.Write("The factorial Factor is :\t");
////for (x = 1; x <= num; x++)
for (y = 1; y <= x; y++)
{
sum += y++;
Console.Write("{0}", sum);
}
//===============
Console.ReadKey();
Sachin SinghRank #66 · 26.2K reputationPosted Oct 24, 2021, 6:55 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Oct 24, 2021, 12:31 AM EDT
Ahmet TahaRank #3,505 · 414 reputationPosted Oct 24, 2021, 1:22 AM EDT
Ahmet TahaRank #3,505 · 414 reputationPosted Oct 28, 2021, 2:03 AM EDT