0
is there an out put of the following?
namespace SoloLearn { class Program { static void Main(string[] args) { constant int a=5; constant int b=6; for (int i =1;i<=5;i++) { a=a*i; b=b*i; } console.WriteLine(a); consol.WriteLine (b); consol.ReadLine(); } } }
4 Réponses
+ 4
You declare a constant with const, not constant. And even then, you are then trying to reassign a value to those constants afterwards. It will just not compile. (Also, you used consol instead of Console, and forgot to include the packages necessary to print.)
0
Constant value can't modifying once you declared variable must assign value the value is fixed
0
You.mean "const"? If yes, the outlut is
5
6
Because you cant modify a constant
0
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int a=5 , b=6;
for (int i =1;i<=5;i++)
{
a=a*i;
b=b*i;
}
console.WriteLine("a is : {0}\nb is : {1}",a,b);
consol.ReadLine();
}
}
}
it doesent need to use const !!!