Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 5
- int main() {
- int i,j,arr[SIZE][SIZE],zm=0;
- for(i=SIZE-1;i>=0;i--)
- {
- if( !(SIZE-i)%2)
- {
- for(j=0;j<SIZE;j++)
- arr[i][j]=zm++;
- }
- else
- {
- for(j=SIZE-1;j>=0;j--)
- arr[i][j]=zm++;
- }
- }
- for(i=0;i<SIZE;i++)//print array
- {
- for(j=0;j<SIZE;j++)
- printf("%d\t",arr[i][j]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement