Blogger Tips And Tricks|Latest Tips For Bloggers Free Backlinks
Showing posts with label Bit operations. Show all posts
Showing posts with label Bit operations. Show all posts

Thursday, 15 November 2012

Write a program to Bit checking the given number using in C language examples?

Bit checking,program to bit checking,C bit checking,bit checking the number,bit checking the given number,C program to bit checking,bit checking program in C,bit checking in C,Write a program to Bit checking the given number using in C language,C program to bit checking the given number


  Bit checking

           This is for the checking the bit or bit checking.
  
                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n&(1<<pos);

                            printf("After bit checking : %d\n",n);
                  }

    Output:
                     Enter numbers
                          6
                          9 
                     After bit checking 0

Write a program to Bit toggle the given number using in C language examples?

Bit toggle,program to bit toggle,C bit toggle,bit toggle the number,bit toggle the given number,C program to bit toggle,bit toggle program in C,bit toggle in C,Write a program to Bit toggle the given number using in C language,C program to bit toggle the given number


  Bit toggle

         The program is for the Bit toggle.
                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n^(1<<pos);

                            printf("After bit toggling : %d\n",n);
                  }

    Output:
                     Enter numbers
                          6
                          8 
                     After bit toggling 262


Write a program to Bitclear the given number using in C language examples?

Bit clear,program to bit clear,C bit clear,bit clear the number,bit clear the given number,C program to bit clear,bit clear program in C,bit clear in C,Write a program to Bit clear the given number using in C language,C program to bit clear the given number


Bit clear the given number

      The below program is developed for Bit clear the number        
                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n&(~(1<<pos));

                            printf("After bit clear : %d\n",n);
                  }

    Output:
                     Enter numbers
                          7
                         
                     After bit clear3

Write a program to Bitset the given number using in C language examples?

Bit set,program to bit set,C bit set,bit set the number,bit set the given number,C program to bit set,bit set program in C,bit set in C,Write a program to Bit set the given number using in C language,C program to bit set the given number


Bit set the given number

 The program is clear about the bit set the number

                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n|(1<<pos);

                            printf("After bitset : %d\n",n);
                  }

    Output:
                     Enter numbers
                          6
                          3 
                     After bitset 14

Print the given number of in binary format using in C program language examples?

Binary format,C binary format,given number in binary format,print in binary format,binary format in C,Print the given number in binary format using in C program language,C program binary format,print in binary format,print the given number in binary,binary format of given number


Binary format of given number

    This one is for print the given number in binary format.
              
                #include<stdio.h>
                main()
                {
                      int n,pos;

                         printf("Enter number\n");
                         scanf("%d",&n);

                              for(pos=31;pos>=0;pos--)
                                 {
                                         if((n&(1<<pos))==0)
                                          printf("0");

                                          else
                                            printf("1");
                                  }
                }

       Output:-
                      Enter number
                             5
                       00000000000000000000000000000101