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(); } } }

25th Oct 2016, 7:25 AM
poool
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.)
25th Oct 2016, 8:44 AM
Zen
Zen - avatar
0
Constant value can't modifying once you declared variable must assign value the value is fixed
25th Oct 2016, 1:10 PM
jishan
0
You.mean "const"? If yes, the outlut is 5 6 Because you cant modify a constant
27th Nov 2016, 9:14 PM
Tomashuyk Maxim
Tomashuyk Maxim - avatar
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 !!!
2nd Jan 2017, 9:33 PM
Amir Hossein Nadimi
Amir Hossein Nadimi - avatar