+ 2
Why it doesn't gives output of more than 8*a for any no.?pls need help
printing table https://code.sololearn.com/cUen5vODgwQH/?ref=app
8 Answers
+ 1
In void display () for loop needs to go to n, not a.
You ask user to input number cin>> n but you are not using it anywhere.
+ 1
Your multiplication method is off. It's not logical to me. You just can't use a and n without having some if statement to check the input value of n. Even then, you'll have to check the value as well in display method.
Number 8 is a random number in the memory. It could be any number really.
+ 1
dρlυѕρlυѕ ,no problems now ,I removed that second function which I thought isn't really necessary ,works as I wanted
0
dρlυѕρlυѕ cout<<"table is as follow"<<n<<"*"<<i<<"="<<n*i;
0
dρlυѕρlυѕ ,why doesn't this Loop runs to 10 for a ,while it works perfectly for n?
0
dρlυѕρlυѕ , thks but this is weird why does it takes 8 as value for any value passed to a variable?
0
dρlυѕρlυѕ Why it's a simple program where it takes the default argument value and prints the table for it upto the no. user inputs?
0
dρlυѕρlυѕ it assigns 5 to a ,so why 8 then?