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
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
c program code snippets
ReplyDeletedouble linked list fragment in c programming