+ 3
Plesae correct my code please
5 Answers
+ 2
No entirely sure what you want to achieve, but you need to initialize your variables to use them in loops (Assign your integers to actual numbers).
I've made a modification of the script here: https://code.sololearn.com/cWxKU9nxZGF0
Where I make n = input and initialize j and i inside the for loops.
+ 1
enter no. for prints stars
0
What is your code suppose to do?
The error you are getting, with this code is:
'variable n might not have been initialized'
So, you need to initialize the variable n, before you can use it.
Meaning, before your first for-loop, you should assign a value to the variable n.
fx.:
'n = ro;'.
Hope this helps.
0
you cont initilize n value
0
give n a value when you initialize it
int n=3;
the problem is your for loop trying to use n
for(int i=0; i<n; i++)