Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update exercises.c #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/exercises.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ int main(int argc, char **argv) {
printf("\n");

//3. Print numbers 1 thru n separated by a comma except for
// the last one; example: 1, 2, 3, 4, 5
the last one; example: 1, 2, 3, 4, 5

//4. Print squares of numbers 1 thru n separated by a comma
// except for the last one; example: 1, 4, 9, 16, 25
except for the last one; example: 1, 4, 9, 16, 25

//5. Compute the summation of numbers 1 thru n and print
// the result; example: 1 + 2 + 3 + 4 + 5 = 15
the result; example: 1 + 2 + 3 + 4 + 5 = 15

//6. Compute the summation of squares of numbers 1 thru n
// and print the result; example: 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55
and print the result; example: 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55

//7. Compute the summation of even numbers 1 thru n and print
// the result; example (n=5): 2 + 4 = 6
/ the result; example (n=5): 2 + 4 = 6

//8. Write a solution to the following variation of the FizzBuzz
// problem. Print out integers 1 thru n, one to a line, except
// that if the integer is divisible by 7 print "Foo" instead.
// If the integer is divisible by 11 print "Bar" instead. If
// the integer is divisible by both 7 and 11, print "FooBar"
// instead.
problem. Print out integers 1 thru n, one to a line, except
that if the integer is divisible by 7 print "Foo" instead.
If the integer is divisible by 11 print "Bar" instead. If
the integer is divisible by both 7 and 11, print "FooBar"
instead.

return 0;
}