Facebook
From shuvo, 2 Weeks ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 214
  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
  21.     printf("enter your number:");
  22.     int num,n,change;
  23.     scanf("%d",#);
  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.  
  32.     /* 2^n er n=? ber korte hobe
  33.     int n, count = 0;
  34.     printf("enter your number:");
  35.     scanf("%d", &n);
  36.     while (n)
  37.     {
  38.         if (!(n & 1))
  39.         {
  40.             count++;
  41.            
  42.         }
  43.         else {break;}
  44.         n = n >> 1;
  45.     }
  46.     printf("%d is %dth power of 2", n, count);*/
  47.  
  48.    
  49.     return 0;
  50. }