In: Computer Science
int f2 (int n) j = 0; while (j <n) {for (int i = 0; i <n; ++ i) {cout << "j =" + j; j = j + 5; }}
ANSWER : HERE IS THE ANSWER FOR YOUR QUESTION:
------------------------------------------------------------------------------------------------------
CORRECT CODE:
#include <iostream>
using namespace std;
int f2 (int n)
{
int j = 0;
while (j <n)
{
for (int i = 0; i <n; ++ i)
{
//you are using +j instead of <<j for the output . thats why
it was giving wrong output
cout << "j = " << j<<endl;
//incrementing
-------------------------------------------------------------------------------------------------------
SNIPPET
---------------------------------------------------------------------------------------------------------
OUTPUT
if you need any further assistance , feel free to provide your comments below
-------------------------------------------------------------------------------------------------------
I hope this would help you out.
If you like my answer , please upvote
If you have any doubt, you can provide comment /feedback below the answer
Thanks