Created
May 9, 2013 00:36
-
-
Save vivanov1410/5544744 to your computer and use it in GitHub Desktop.
Solution for tasuku 3 Fiby
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
| // tasuku3.c | |
| #include <stdio.h> | |
| #define MAX_LIMIT 4000000 | |
| int main(int argc, char const *argv[]) { | |
| // counter for basic operations | |
| int counter = 0; | |
| int sum = 0; | |
| int a = 2, b = 3, c = 5; | |
| while(a < MAX_LIMIT) { | |
| sum += a; | |
| a = b + c; | |
| b = a + c; | |
| c = a + b; | |
| // basic operation here is summation | |
| counter += 3; | |
| } | |
| printf("Answer is %d\n", sum); | |
| printf("Total basic operation are %i\n", counter); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment