#include <iostream>
using namespace std;
const int CITY = 2;
const int WEEK = 7;
int main()
{
int temperature[CITY][WEEK];
cout << "Enter all temperature for a week of first city and then second city. \n";
// Inserting the values into the temperature array
for (int i = 0; i < CITY; ++i)
{
for(int j = 0; j < WEEK; ++j)
{
cout << "City " << i + 1 << ", Day " << j + 1 << " : ";
cin >> temperature[i][j];
}
}
cout << "\n\nDisplaying Values:\n";
// Accessing the values from the temperature array
for (int i = 0; i < CITY; ++i)
{
for(int j = 0; j < WEEK; ++j)
{
cout << "City " << i + 1 << ", Day " << j + 1 << " = " << temperature[i][j] << endl;
}
}
return 0;
}
Friday, 3 May 2019
temperature for a week of first city
Subscribe to:
Post Comments (Atom)
Directory implementation
The selection of directory-allocation and directory-management algorithms significantly affects the efficiency, performance, and reliabil...
-
Recursivity Recursivity is the property that functions have to be called by themselves. It is useful for some tasks, such as sorting elem...
-
structure is a collection of variables of different data types under a single name. It is similar to a class in that, both holds a coll...
No comments:
Post a Comment