0
Write a C++ program to produce the output shown below using Loop structure notation:
enter an integar:5 5*1=5 5*2=10 5*3=15 5*4=20 5*5=25 5*6=30 5*7=35 5*8=40 5*9=45 5*10=50
6 Respuestas
+ 2
Younis Ahmad have you copied some line from internet .
Your while loop syntex is invalid . First check the syntex of while u have written for loop syntex and u used while replace it with for it will work fine
#include <iostream>
using namespace std;
int main() {
int n=5;
for (int i=1; i<=10;i++){
cout<<n<<" * "<<i<<" = "<<n*i<<endl;
}
return 0;
}
+ 2
what's your doubt Younis Ahmad
https://www.sololearn.com/discuss/1316935/?ref=app
+ 2
hey Younis Ahmad
complete your C++ course , you will understand what the while loop is.
>>>you are using while instead of for loop
int n=5;
int i=1;
while(i<=10)
{ cout<<n<<"*"<<i<<"="<<n*i<<endl;
i++; }
0
Your attempt. Please.
0
#include <iostream>
using namespace std;
int main()
{
int n = 5; // Change here to change output
while (int i = 1; i <= 10; ++i)
cout << n << " * " << i << " = "
<< n * i << endl;
return 0;
}
0
i wanna do this by while how can write