Left Shift Multiplier
C
Hard
7 views
Problem Description
Left shift the number and multiply it by 2. Neither
Official Solution
#include <stdio.h>
int main() {
int n1 = 5;
int n2 = -5;
printf("Positive number:n");
printf("5 << 1 = %dn", n1 << 1);
printf("5 << 2 = %dn", n1 << 2);
printf("nNegative number:n");
printf("-5 << 1 = %dn", n2 << 1);
printf("-5 << 2 = %dn", n2 << 2);
return 0;
}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!