CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sololearn
{
class Program
{
static void Main(string[] args)
{
// What's this code's output?
int a,c;
a = 1;
//if statement which will run if the `a` value is 1.
//we have already declared the value of a that is 1
if (a==1)
{
//First print the value of a then increament it by 1.After it print 1 then the value of a will 2.
Console.WriteLine(a++);
}
//This is else statement and will run if the above `if` statement is false.
//But above statement is true.So this `else` statement will be ignored.
else{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run