0
I just wrote a code for multiplication for input of any number till the 20 multiples .
// the multiplication table of any input number till its 20 multiples #include <iostream> using namespace std; int main() { int num; cout<<"The Multiplication table of "; cin>>num; int numstatic=num; int multiple=0; cout<<num<<" till it 20 Multiples is \n"; while (num < numstatic*20+1) { multiple ++; cout<<numstatic<<"Ă"<<multiple<<"="<< num << endl; num = num + numstatic; } return 0; } Everything works fine when I remove cin and put some value of num but when I make num as input by putting cin as in the code it gives out of some number like 32627
6 Answers
+ 2
Aquib Javid Mir oh ok I didn't understood the question really ,
+ 1
The code that you have in your description works fine for me , not sure what you are taking about
+ 1
Abhay actually while after I run the code I get output as
32627Ă1
32627Ă2.....
However ,shouldn't I get the output as
0Ă1
0Ă2.....
Because there is not input till now
0
That's a garbage value.
That you will get, if you not assigning value before using it..
0
Jayakrishnađźđł thanks
0
You're welcome..