0% found this document useful (0 votes)
9 views1 page

Exercise Questions 1

The document outlines an introductory lab exercise involving basic integer operations like declaration, assignment, addition, and calculating the perimeter and area of a rectangle by prompting the user for input.

Uploaded by

hicape5709
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Exercise Questions 1

The document outlines an introductory lab exercise involving basic integer operations like declaration, assignment, addition, and calculating the perimeter and area of a rectangle by prompting the user for input.

Uploaded by

hicape5709
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

LAB Exercise - 1

1. Declaration and Assignment with integers:

a. Define an integer called a.

b. Print the value of a.

c. Assign 5 to a.

d. Print the value of a.

2. Console Input (scanf)

a. Declare an integer called b.

b. Prompt (ask) the user for the value of b.

c. Print the value of b.

3. Addition of Two Integers:

a. Declare an integer called firstNumber.

b. Declare an integer called secondNumber.

c. Declare an integer called sum.

d. Prompt (ask) the user for the value of firstNumber and secondNumber.

e. Assign the sum of firstNumber and secondNumber to sum.

f. Print the result like firstNumber + secondNumber = sum.

4. Perimeter and Area of Rectangle:

a. Declare an integer called length.

b. Declare an integer called width.

c. Prompt (ask) the user for the value of length and width.

d. Print the perimeter of rectangle.

e. Print the area of rectangle.

You might also like