Blogger Tips And Tricks|Latest Tips For Bloggers Free Backlinks

Thursday 15 November 2012

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

1 comments: