#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...
-
A stream is a name given to a flow of data at the lowest level. At the lowest level, data is just the binary data without any notion of da...
-
Pointers are powerful features of C++ that differentiates it from other programming languages like Java and Python. Pointers are used in...
-
#include <iostream> using namespace std ; int sum ( int a , int b = 10 , int c = 20 ); int main (){ /* In this case...
No comments:
Post a Comment