0% found this document useful (0 votes)
48 views

National University of Modern Languages (Numl) : Paste Your Code Here

The document contains instructions for a programming lab assignment involving arrays in C++. The lab tasks include: 1) Reading in and displaying an array in reverse order, 2) Converting between Celsius and Fahrenheit temperatures and storing in arrays, and 3) Analyzing patient data from multiple cities to find highest and lowest values. Further tasks involve defining and displaying 2D arrays in different formats and finding the second and third smallest elements in an integer array.

Uploaded by

Editor Choice
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

National University of Modern Languages (Numl) : Paste Your Code Here

The document contains instructions for a programming lab assignment involving arrays in C++. The lab tasks include: 1) Reading in and displaying an array in reverse order, 2) Converting between Celsius and Fahrenheit temperatures and storing in arrays, and 3) Analyzing patient data from multiple cities to find highest and lowest values. Further tasks involve defining and displaying 2D arrays in different formats and finding the second and third smallest elements in an integer array.

Uploaded by

Editor Choice
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

NATIONAL UNIVERSITY OF MODERN LANGUAGES (NUML)

BS- IT 1ST Semester


CSPF - 101 PROGRAMMING FUNDAMENTS
Course Instructor: _____________________________________
Student Name: _____________________________________
Lab #: _____________________________________
Lab Title: _____________________________________
Date: _____________________________________

Lab Tasks:

1. Write a program in C++ that takes ten numbers from user as an input in an
array and then displays the whole array with numbers in the same sequence
as they were entered. Now print the whole array in reverse order i.e. last
entered number comes first and first one appears at the end using loops.

Solution
Paste your code here:
Output:

2. Write a program in C++ that takes the temperature in Celsius of all the days of the
week from user, converts them into Fahrenheit temperatures and stores them in
another array. Display the contents of both arrays. Google search for the
temperature conversion formula. Verify all of your results.
3.
Solution
Paste your code here:

Output:
3. Write a program in C++ that takes input of the number of coronavirus patients
from twelve different cities of the world and displays the total count of patients.
Also, your program should have the capability to perform analysis and detect the
highest and lowest number of patients among these cities.
Solution
Paste your code here:
Output:

4. Define the following 2D array in C++ and then display each element in
following manner(s)
Solution
Paste your code here:
A:
B:

Output:
A:

B:
5. Define the following 2D array and program shall display the transposed
array. int arr[2][3]= {{10,20,30}, {40,60,50}}

Solution
Paste your code here:

Output:
6. Write a C++ program to find the second and third smallest elements in a
given array of integers.

Solution
Paste your code here:

Output:

You might also like