Skip to main content

Practical No.7: Write a program to find the area of a rectangle

 

Practical No.7: Write a program to find the area of a rectangle

ACTIVITY 7

Practical No.7:
Write a program to find the area of a rectangle.





OR

By Sir Sajjad Akber Chandio


ALGORITHM

  • step 1: start
  • step 2: Declare variables
  • step 3: Take input for length
  • step 4: Take input for width
  • step 5: calculate area by multiplying length by width
  • step 6: Print Area
  • step 7: End


VIVA VOCE
ACTIVITY 7

Q.1: What do you understand by an area of rectangle?
Ans: Area of rectangle is the region occupied by a rectangle within its four sides or boundaries.


Q.2: Write down the formula to calculate area of rectangle.
Ans: The area of a rectangle is the product of its length and width. So, area of rectangle = (length x width).

Q.3: Which type of operator is used in this program?
Ans: Arithmetic multiplication operator is used in this program.

Q.4: What is the purpose of return keyword used in C++?
Ans: This statement is used to return the value to the operating system. By default, main function returns integer value 0.

Q.5: Function cout belongs to which header file?
Ans: cout function belongs to header file iostream.

Comments

Popular posts from this blog

Dear Students Welcome to my blog.  It is to inform you that. now you can download your 10th class Computer Science book in PDF. Share with your other students.  Kindly Share your comments on my blog to support me.                                                                                   Download

Class X Test / Model Paper Chapter No 1 Computer

                                                                                Subject: Computer Science                                          Class: -10                                        Date: 4 Jan 2023 Test   # 1   Short Test (MCQs=6, SQs=8, LQs=1)     ...

Inter Board Karachi Guess/Model Papers 2023 (1st year & 2nd year)

  Inter Board Karachi Guess/Model Papers 2023 Board Karachi Model Papers 2023 Computer's Guess Paper 9th Class 2023 Computer's Guess Paper 9th Class 2026 Computer's Guess Paper  10th Class 2023 Computer's Guess Paper 11th Class 2023 Computer's Guess Paper  12th Class 2023 Prepared By Sir Rana Arsalan Inter Part-I Model Papers Inter Part-II Model Papers Model Paper Mathematics I Model Paper Mathematics II Model Paper Islamiat Model Paper Urdu II Model Paper Urdu I Model Paper Pakistan Studies Model Paper Botany I Model Paper Botany II Model Paper Chem I — MCQs Model Paper Chem II — MCQs Model Paper Physics I Model Paper Physics II Model Paper Zoology I Model Paper Zoology II Model Paper English I Model Paper English II