Write a program that uses the following three structures to store the weather data for a particular month:
#include <iostream>
using namespace std;
struct weather{
double rainfall;
double humidity;
double temperature;
};
int main()
{
struct weather w;
cout<<"\nEnter rainfall: ";
cin>>w.rainfall;
cout<<"\nEnter humidity: ";
cin>>w.humidity;
cout<<"\nEnter temperature: ";
cin>>w.temperature;
cout<<"rainfall: "<<w.rainfall;
cout<<"humidity: "<<w.humidity;
cout<<"temperature: "<<w.temperature;
return 0;
}
Comments
Leave a comment