[QUOTE=aijaz;27389]hello frends ... i need sme help in developing some programs in C
Code:
1) i want the out like this 1
1 1
1 1 2
1 1 2 3
1 1 2 3 5
1 1 2 3 5 8 ... & soon .. till the range i specify
... here you can see tht we are adding the Diagonal digits ... plz help
Code:
public class Pattern {
public static void main(String[] args) {
for(int i=1;i<7;i++) {
int p=0,n=1,t;
for(int j=1;j<=i;j++) {
System.out.print(n);
t=n;
n+=p;
p=t;
}
System.out.println("");
}
}
}