Pattern with zeroes

In every row what will be the rule for placing zeroes in every row.i place nos but not zeroes

hi @kumarakash121005
u can refer my code -->

#include<iostream>
using namespace std;
int main(){
	int n,i,j;
	cin>>n;
	for(i=1;i<=n;i++){
		for(j=1;j<=i;j++){
			
			if(j==1 || j==i){
				cout<<i<<"\t";
			}
			else{
				cout<<0<<"\t";
			}
		}
	cout<<endl;	
}
return 0;	
}

hi @kumarakash121005
i hope is clear now… do u still have any doubt regarding it??

hi @kumarakash121005
do u still face any difficulty or its clear now???

Error comes with time limit exceeded

bro problem kaunse ques mei hai?? pattern with zeros wale mei ya selection sort mei??? pattern with zeros wala code to bheja upr… it works fine…

Pattern with zeroes wale m mera tle aa rha h

Have u tried the code I sent u??

No but I work with same logic

Share ur code then … will check it

Ek baar aapka code chla ke try krta hu

Yes… if u still face any difficulty do let me know

hi @kumarakash121005
do u still face any difficulty???

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.