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

25th May 2021, 8:08 PM
Younis Ahmad
Younis Ahmad - avatar
6 ответов
+ 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; }
26th May 2021, 3:06 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
26th May 2021, 1:21 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
+ 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++; }
26th May 2021, 7:16 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
0
Your attempt. Please.
25th May 2021, 8:08 PM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
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; }
25th May 2021, 8:18 PM
Younis Ahmad
Younis Ahmad - avatar
0
i wanna do this by while how can write
26th May 2021, 5:11 AM
Younis Ahmad
Younis Ahmad - avatar