Commit 669a9339 authored by Artak Yenokyan's avatar Artak Yenokyan

Merge branch 'exercise_05_09' into 'master'

Mary Zaqaryan Exercise_05_09 Version1 See merge request bpcarm/trainings2017!1305
parents 54ad6862 e6ff8aca
#include <iostream>
int
main()
{
int prod = 1;
for (int i = 1; i <= 15; i += 2) {
prod *= i;
}
std::cout << "Product of odd numbers between 1 and 15 is " << prod << std::endl;
return 0;
}
exercise_05_09: exercise_05_09.o | .gitignore
g++ $^ -o $@
exercise_05_09.ii: exercise_05_09.cpp
g++ -E $^ -o $@
exercise_05_09.s: exercise_05_09.ii
g++ -S $^ -o $@
exercise_05_09.o: exercise_05_09.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_05_09" > $@
removes:
rm *.ii *.s *.o *.out exercise_05_09 .gitignore
test: exercise_05_09
./exercise_05_09 > test.out
diff test.out test.expected > /dev/null 2>&1 && echo PASSED || echo FAILED
Product of odd numbers between 1 and 15 is 2027025
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment