Sunday, 18 May 2014

#include<iostream>

int main()
{
   using namespace std;

   unsigned int a=0;

   int aa=-10;
   a=(unsigned int)aa;
   cout<<"\nUNSIGNED COUT"<<a;
   printf("\nUNSIGNED PRINTF\n  :: %d ",a  );

   return 0;

}



OUTPUT
========================================


UNSIGNED COUT4294967286
UNSIGNED PRINTF -10
#include<iostream>
#include <stdlib.h>
int main()
{
   using namespace std;

   int i=0,item_read=0,j=0;


   while(true)
   {
      item_read=0;
      item_read=scanf("%d%d",&i,&j);
      

      if(item_read == 2)
      {
         printf(" Items read :: %d",item_read );
      }
      else
      {
         printf("\nError in reading!!!!!!");
         getchar();
         continue;
      }

   }


   return 0;
}



OUTPUT
========================================

11

2
 Items read :: 2










#include<iostream>

class class_test
{
   public:
      static int a;

};

int class_test::a; // Declare before use
int main()
{
   using namespace std;
 //   int class_test::a; Cannot declare here
   class_test::a=20;
   printf("\n class_test::a :: %d ", class_test::a );
  
   return 0;
}



OUTPUT
========================================

class_test::a :: 20