can anyone tell where's the problem when I print out the code the first line shouldn't be empty and yet and the first line is empty and the staircase starts from the second line here's my code<
#include <iostream>
using namespace std;
int main(){
int o ;
scanf("%d",&o);
int n=o+1;
for(int g=0; g<n; g++){
for(int h=0; h < n ;h++) {
if(g+h>=n){ cout<<"#";}
if(g+h< n ){ cout<<" ";}
}
cout<<"\n";
}
}
Given the input "3" ENTER, here's the output:
THIS LINE IS EMPTY IN THE TERMINAL
#
##
###