Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

hamido

#include <stdio.h>

int main()
{
    int i, j, x = 0, e = 0, A[5][5];
	for(i = 0; i < 5; i++)
	{
		if(i % 2 == 0)
		{
			for(j = x + 1; j <= x + 5; j++)
			{
				A[i][e] = j;
				e++;
        		
			}
		} else {
			x += 10;
			for(j = x; j > x - 5; j--)
			{
				A[i][e] = j;
				e++;
			}
		}
    	e = 0;
	}
	
	for(i = 0; i < 5; i++)
	{
		for(j = 0; j < 5; j++)
			printf("%d\t", A[i][j]);
		printf("\n");
	}

    return 0;
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.