CP LAB 10.docx - Department of Computer Science Lab Journal 09(Spring 2020 Course Course Code Faculty\u2019s Name Name Computer Programming Lab CSL-113

CP LAB 10.docx - Department of Computer Science Lab Journal...

This preview shows page 1 - 3 out of 3 pages.

Department of Computer Science Lab Journal 09 (Spring 2020) Course: Computer Programming Lab Date: Course Code: CSL-113 Max Marks: 30 Faculty’s Name: Lab Engineer: Name: Enroll No: Class: Objective(s): To Understand about: 1. Apply Arrays in C++ 2. Use of One Dimesional Array Lab Tasks: // Output Elements Square ======== ======= 0 0 1 1 2 4 3 9 4 16 ----------------------------- For Instructor Use Only -----------------------------------Lab Grading Sheet : Task Max Obtained Comments( if any )
Image of page 1
Enrollment Number: 03-134192-002 Mark s Marks 1. 10 2. 10 3. 10 Total 30 Signature: Note : Attempt all tasks and get them checked by your Lab. Instructor. **Provide solution of each task and screenshot of output at the end of that task** Task 1 Write a program to input array elements and output is labeled, like this: < Solution and output of Task 1 > #include <iostream> using namespace std; int main() { float array[5] = { 0 }; cout << "Please, Enter 5 Numbers: " << endl; for ( int i = 0; i <= 4; i++) { cout << "\ta[" << i << "] : " ; cin >> array[i]; } cout << endl; cout << "In reverse order, they are: " <<
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '18
  • Zia Ul Rehman
  • Chemistry, Array, Chemical element, Lab Engineer

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes