Tuesday, November 13, 2012

Weather program in C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h> 

 #include<windows.h>   
int main()
{
int w;
int a,b;
system("color 5e");


cout<<"   ASIM KHAN BANGASH"<<endl;
cout<<"Enter month numbers between 1 and 12:";
cin>>w;
switch(w)
{
case 1:
case 2:
case 11:
case 12:
cout<<"The weather is winter";
break;
case 9:
case 10:
cout<<"The weather is Autum";
break;
case 3:
case 4:
cout<<"The weather is Spring";
break;
case 5:
case 6:
case 7:
case 8:
cout<<"The weather is Summer";
break;
defualt:
cout<<"You entered an Invalid month";
}
getch();
return 0;
}
   

No comments:

Post a Comment