From shuvo, 4 Months ago, written in Plain Text.
Embed
Hits: 244
1. #include <stdio.h>
2. int main()
3. {
4.
5.     /*~n=-(n+1)
6.     int a=-10;
7.     int b=~a;
8.     printf("a=%d",a);
9.     printf("b=%d",b);
10.     */
11.     /*even or odd
12.     1 er shathe & korle odd hole true hobe,even hole false hobe
13.     int x;
14.     scanf("%d",&x);
15.     if(x&1){
16.         printf("%d is odd",x);
17.     }
18.     else printf("%d is even",x);*/
19.
20.     /*nth bit er value on korte hobe
22.     int num,n,change;
23.     scanf("%d",&num;);
24.     printf("enter the number of bit you want to reverse:");
25.     scanf("%d",&n);
26.      change=(1<<n)|num;//ekhane 1<<>> 1;
27.     }
28.
29.     printf("number of 1:%d",count);*/
30.
31.     /* 2^n er n=? ber korte hobe
32.     int n, count = 0;
34.     scanf("%d", &n);
35.     while (n)
36.     {
37.         if (!(n & 1))
38.         {
39.             count++;
40.
41.         }
42.         else {break;}
43.         n = n >> 1;
44.     }
45.     printf("%d is %dth power of 2", n, count);*/
46.
47.     /*2 ta number same kina
48.     int x,y;;
49.         printf("enter two number:");
50.         scanf("%d %d", &x,&y);
51.         if(!(x ^ y)){
52.     printf("the numbers are equal");
53.         }
54.         else{printf("the numbers are not equal");}*/
55.
56.
57.         //bits=sizeof(int)*8
58.
59.     return 0;
60. }