Thursday, September 13, 2018

BITWISE OPERATOR

  • Problem Description

    Kernel had an idea to use bitwise operator. He tries to do some multiplication operation. So he select a nu mber that should be multiplied by 4. His task is to write a c program to multiply given number by 4 using bitwise operators
  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int a,b;
      scanf("%d",&a);
      b=a*4;
      printf("%d*4=%d",a,b);
      

    return 0;
    }
  • Test Case 1

    Input (stdin)
    1
    
    
    Expected Output
    1*4=4
  • Test Case 2

    Input (stdin)
    2
    
    
    Expected Output
    2*4=8

No comments:

Post a Comment