diff --git a/Lesson 1/Activity 1 - Find the Factors of 7 between 1 and 100 using while Loop/main.cpp b/Lesson 1/Activity 1 - Find the Factors of 7 between 1 and 100 using while Loop/main.cpp index ca20afd..1d20ee8 100644 --- a/Lesson 1/Activity 1 - Find the Factors of 7 between 1 and 100 using while Loop/main.cpp +++ b/Lesson 1/Activity 1 - Find the Factors of 7 between 1 and 100 using while Loop/main.cpp @@ -2,12 +2,16 @@ int main() { - unsigned i = 1; - while ( i <= 100) { - if (i%7 == 0) { - std::cout << i << std::endl; - } - i++; +// unsigned i = 1; +// while ( i <= 100) { +// if (i%7 == 0) { +// std::cout << i << std::endl; +// } +// i++; +// } + for(int i=0; i<100; i+=7){ //this will reduce the time complexity of the program. + std::cout<< i << std::endl; } + -} \ No newline at end of file +}