What Will Be The Output Of The Following Code In Cp Pre Langcpp #1105
What will be the output of the following code in C++?</p> <pre><code class="language-cpp"> #include <stdio.h> int ETF(int n) { int a, result = n; for (a = 2; a * a <= n; ++a) { if (n % a == 0) { while (n % a == 0) n = n / a; result = result - result / a; } } if (n > 1) result = result - result / n; return result; } int main() { int n; for (n = 1; n <= 4; n++) printf("%d\n", ETF(n)); return 0; } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs122 Data Communication and Computer Network. It can also be found in gs gs122 Number Theory - Euler’s Totient Function - Quiz No.1.
Similar question(s) are as followings:
Online Quizzes of gs122 Data Communication and Computer Network
Sorting - Insertion Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.3
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - LSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes