Register now or log in to join your professional community.
a) Code report errorb) Code runs in infinite loop conditionc) Code gives output asd) Code give output as
In the below for loop statement
for (i = 1; i <= ; s = s + i, i++) ;
{
Console.WriteLine(s);
}
You will get compile time on the code: i <= ;
Because at the right-hand side of the condition you forgot to write any value.
error saying incorrect loop condition.
a) Code report error
error ; i <= ; this is not valid condition
a) Code report error:
In the condition statement of the for loop the i is not given a value to compare against so it throws error "invalid expression term".
It will display 0.
That is everything.
No The code Working