Created
February 11, 2015 19:48
-
-
Save shohan4556/1b371f4d252900659cb3 to your computer and use it in GitHub Desktop.
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> | |
| #include<math.h> | |
| // a. find out p=2^15 | |
| // b. print the last digit of p | |
| int main() | |
| { | |
| int ans,i,n,j; | |
| n=10; | |
| ans=2; | |
| for(i=2;i<=15;i++){ | |
| ans=ans*2; | |
| ans=ans%10; // if I want to know the last one digit of the number of the sum of the sequence | |
| } | |
| printf("ans :%d",ans); | |
| return 0; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment