only possible for continuous disctees attributes. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
#include<iostream> using namespace std; void zigzagPrint( int a[3][3]) { int i,j, var, temp1, temp2; for(i=0, j=0;i<3,j<3;) { temp1=i,temp2=j; int diff=i-j; for(var=0;var <= diff ;var++,temp1--,temp2++) { cout<<a[temp1][temp2]<<"\t"; } cout<<"\n"; i<2?i++:j++; } } int main() { int a[3][3]={1,2,3,4,5,6,7,8,9}; zigzagPrint(a); }