Saturday, 19 November 2011

C ++ program

# include <iostream.h>
void main ( )
{
  int n ;
  cout << "read n" ;
  cin >>n ;
  if ( n = = 1)
 {
  cout << "sunday" ;
 }
else if ( n = = 2)
 {
   cout << "monday" ;
  }
else if ( n = = 3) 
 { 
   cout << "tuesday" ;
  }
else if ( n = = 4)
 { 
   cout <<"wednesday";
  }
else if ( n = = 5)
  { 
    cout << "thursday" ;
   }
 else if ( n = =6)
   {
     cout << "friday" ;
   }
   else if (n = = 7 )
  {
   cout <<"saturday" ;
  }
 {
  cout <<"invalid input";
 }
}


  
             C++ PROGRAM
# include <iosream.h>
void main( )
{
 char x ;
cout <<"enter a character";
cin >> x;
if ( x >=&& x<='90')
{
  x=x+32;
  cout << x ;
}
else if (x=97 && x<=122)
{
   x=x-32;
   cout << x ;
}
else
{
cout <<"invalid";
}
}