Why wont this work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
26th Jul 2017, 11:30 AM
Vasanth Mani Vasi Venkatram Vasi
Vasanth Mani Vasi Venkatram Vasi - avatar
11 Answers
+ 2
https://code.sololearn.com/cYX6lU3B33rC/?ref=app You'd like to see smth like this one? It's a multiplication table for a and b; a is your input, b changes between 1 and 10
26th Jul 2017, 11:41 AM
Alex Sweetheart
Alex Sweetheart - avatar
+ 8
You redefined "a" in the for loop. Try this. #include <iostream> using namespace std; int main() { int a; cin>>a; for(a;a<=10;a+=a) {cout<<a;} return 0; }
26th Jul 2017, 11:40 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 2
//hope this code helps you #include <iostream> using namespace std; int main() { int b, c; cin>>b; for(int a=0;a<=10;a++) { c=b*a; cout<<c<<"\n"; } return 0; }
26th Jul 2017, 12:02 PM
Sreejith P
Sreejith P - avatar
+ 2
your errors you redefined 'a' in for loop, initialization expression & conditional expression is not correct and you didn't write command for print multiplication table for given number
26th Jul 2017, 12:05 PM
Sreejith P
Sreejith P - avatar
+ 1
You're welcome!
26th Jul 2017, 11:49 AM
Alex Sweetheart
Alex Sweetheart - avatar
+ 1
oh ok thanks @sreejit
26th Jul 2017, 12:44 PM
Vasanth Mani Vasi Venkatram Vasi
Vasanth Mani Vasi Venkatram Vasi - avatar
0
it's a code to display the multiplication table for a number given by the user. pls help.
26th Jul 2017, 11:31 AM
Vasanth Mani Vasi Venkatram Vasi
Vasanth Mani Vasi Venkatram Vasi - avatar
0
WOW!!! THANKS A LOT!! I WANTED TO CHOOSE BOTH OF YOUR ANSWERS AS THE BEST.
26th Jul 2017, 11:46 AM
Vasanth Mani Vasi Venkatram Vasi
Vasanth Mani Vasi Venkatram Vasi - avatar
0
Thanks @AlexSweetheart.
26th Jul 2017, 11:46 AM
Vasanth Mani Vasi Venkatram Vasi
Vasanth Mani Vasi Venkatram Vasi - avatar
0
Thanks @ArchanaWadhwani
26th Jul 2017, 11:55 AM
Vasanth Mani Vasi Venkatram Vasi
Vasanth Mani Vasi Venkatram Vasi - avatar