Last active
July 1, 2020 05:19
-
-
Save officialcjunior/bb51a329816dd6f626ea35f796d55e02 to your computer and use it in GitHub Desktop.
A program to find the powers of two using bits, without a loop or any other functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main () | |
{ | |
int n, val; | |
printf("Enter the value for n \n"); | |
scanf("%d",&n); | |
printf("2^%d is %d \n",n,2<<(n-1)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment