Write a C# statement to accomplish each of the following tasks: a) Declare the int variable sum

Question:

Write a C# statement to accomplish each of the following tasks:

a) Declare the int variable sum and initialize it to 0.

b) Declare the int variable x and initialize it to 1.

c) Add variable x to variable sum, and assign the result to variable sum.

d) Display "The sum is: ", followed by the value of variable sum.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Visual C# How to Program

ISBN: 978-0134601540

6th edition

Authors: Paul J. Deitel, Harvey Deitel

Question Posted: